Fix clippy errors and some warnings.
TEST=cargo test
Change-Id: I91afe78141c717a592eec5ec77acac2a500ba163
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2623941
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Andrew Walbran <qwandor@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Andrew Walbran <qwandor@google.com>
diff --git a/src/main.rs b/src/main.rs
index 5d02af0..d8645e5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -598,8 +598,8 @@
if let Some(s) = s {
let opts = s
- .split(",")
- .map(|frag| frag.split("="))
+ .split(',')
+ .map(|frag| frag.split('='))
.map(|mut kv| (kv.next().unwrap_or(""), kv.next().unwrap_or("")));
for (k, v) in opts {
@@ -759,7 +759,7 @@
SerialHardware::Serial => {}
_ => {
return Err(argument::Error::InvalidValue {
- value: serial_params.hardware.to_string().to_owned(),
+ value: serial_params.hardware.to_string(),
expected: String::from("earlycon not supported for hardware"),
});
}
@@ -1187,7 +1187,7 @@
})?;
let dur = Duration::from_secs(seconds);
- shared_dir.fs_cfg.entry_timeout = dur.clone();
+ shared_dir.fs_cfg.entry_timeout = dur;
shared_dir.fs_cfg.attr_timeout = dur;
}
"cache" => {