Update code for Rust 1.82.0
error: unneeded `return` statement
--> packages/modules/Virtualization/libs/libvmbase/src/arch/aarch64/platform.rs:109:5
|
109 | return CONSOLES[id].get().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `-D clippy::needless-return` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_return)]`
help: remove `return`
|
109 - return CONSOLES[id].get().unwrap();
109 + CONSOLES[id].get().unwrap()
Test: m out/soong/.intermediates/packages/modules/Virtualization/libs/libvmbase/libvmbase/android_arm64_armv8-a_cortex-a53_rlib_rlib-std/libvmbase.rlib.clippy
Bug: 384401387
Change-Id: I28874cdd468bda1bab26cf4f532cf952efd80675
diff --git a/libs/libvmbase/src/arch/aarch64/platform.rs b/libs/libvmbase/src/arch/aarch64/platform.rs
index 6a62f8c..b33df68 100644
--- a/libs/libvmbase/src/arch/aarch64/platform.rs
+++ b/libs/libvmbase/src/arch/aarch64/platform.rs
@@ -106,7 +106,7 @@
///
/// Panics if console was not initialized by calling [`init`] first.
pub fn uart(id: usize) -> &'static spin::mutex::SpinMutex<Uart> {
- return CONSOLES[id].get().unwrap();
+ CONSOLES[id].get().unwrap()
}
/// Reinitializes the emergency UART driver and returns it.