diff options
author | David Tolnay <dtolnay@chromium.org> | 2018-12-01 17:49:30 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-12-03 20:32:03 -0800 |
commit | 5bbbf610828e975fd308b90543359a85ef59b67f (patch) | |
tree | 4cd736628475d702b7ac45feb2e359c3fb74d220 /src/main.rs | |
parent | 21fb34fb937678d85e9bfa4c721ab4a29196c764 (diff) | |
download | crosvm-5bbbf610828e975fd308b90543359a85ef59b67f.tar crosvm-5bbbf610828e975fd308b90543359a85ef59b67f.tar.gz crosvm-5bbbf610828e975fd308b90543359a85ef59b67f.tar.bz2 crosvm-5bbbf610828e975fd308b90543359a85ef59b67f.tar.lz crosvm-5bbbf610828e975fd308b90543359a85ef59b67f.tar.xz crosvm-5bbbf610828e975fd308b90543359a85ef59b67f.tar.zst crosvm-5bbbf610828e975fd308b90543359a85ef59b67f.zip |
lint: Resolve the easier clippy lints
Hopefully the changes are self-explanatory and uncontroversial. This eliminates much of the noise from `cargo clippy` and, for my purposes, gives me a reasonable way to use it as a tool when writing and reviewing code. Here is the Clippy invocation I was using: cargo +nightly clippy -- -W clippy::correctness -A renamed_and_removed_lints -Aclippy::{blacklisted_name,borrowed_box,cast_lossless,cast_ptr_alignment,enum_variant_names,identity_op,if_same_then_else,mut_from_ref,needless_pass_by_value,new_without_default,new_without_default_derive,or_fun_call,ptr_arg,should_implement_trait,single_match,too_many_arguments,trivially_copy_pass_by_ref,unreadable_literal,unsafe_vector_initialization,useless_transmute} TEST=cargo check --features wl-dmabuf,gpu,usb-emulation TEST=boot linux Change-Id: I55eb1b4a72beb2f762480e3333a921909314a0a2 Reviewed-on: https://chromium-review.googlesource.com/1356911 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 75ad172..2f0320b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -137,7 +137,7 @@ fn wait_all_children() -> bool { } // If we've made it to this point, not all of the children have exited. - return false; + false } fn set_argument(cfg: &mut Config, name: &str, value: Option<&str>) -> argument::Result<()> { @@ -215,7 +215,7 @@ fn set_argument(cfg: &mut Config, name: &str, value: Option<&str>) -> argument:: } cfg.params.push(format!( "root=/dev/vd{} ro", - char::from('a' as u8 + cfg.disks.len() as u8) + char::from(b'a' + cfg.disks.len() as u8) )); } cfg.disks.push(DiskOption { @@ -628,12 +628,10 @@ fn create_qcow2(mut args: std::env::Args) -> std::result::Result<(), ()> { .open(&file_path) .map_err(|e| { error!("Failed opening qcow file at '{}': {:?}", file_path, e); - () })?; QcowFile::new(file, size).map_err(|e| { error!("Failed to create qcow file at '{}': {:?}", file_path, e); - () })?; Ok(()) |