cleanup: Fix previously disabled clippy checks
There were not too many cases here. This fixes:
- comparison_chain
- wrong_self_convention
- upper_case_acronyms
- from_over_into
- let-and-return
The collapsible_if check is moved to the permanently
allowed checks. The cases we do have improve
readability or semantics.
BUG=chromium:908640
TEST=Kokoro
Change-Id: I6e905d08e2a87aa0862d4d1cf5ff57b60e95fa7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3278776
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
diff --git a/src/main.rs b/src/main.rs
index 81ef6b9..1754dc4 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2089,12 +2089,10 @@
}
}
#[cfg(all(target_arch = "x86_64", feature = "gdb"))]
- if cfg.gdb.is_some() {
- if cfg.vcpu_count.unwrap_or(1) != 1 {
- return Err(argument::Error::ExpectedArgument(
- "`gdb` requires the number of vCPU to be 1".to_owned(),
- ));
- }
+ if cfg.gdb.is_some() && cfg.vcpu_count.unwrap_or(1) != 1 {
+ return Err(argument::Error::ExpectedArgument(
+ "`gdb` requires the number of vCPU to be 1".to_owned(),
+ ));
}
if cfg.host_cpu_topology {
// Safe because we pass a flag for this call and the host supports this system call