From 5eb7743abd467cdad2db07cdd4c819d2d53816da Mon Sep 17 00:00:00 2001 From: Dennis Kempin Date: Mon, 7 Feb 2022 11:29:09 -0800 Subject: [PATCH] clippy: Fix cros_async This is the last one. Just a few nits and we can now run clippy on all crates. BUG=b:192373803 TEST=./tools/presubmit Change-Id: I93ad9ce3b1cf0718bda8588279d7e1a891a0a6f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3439052 Reviewed-by: Noah Gold Reviewed-by: Daniel Verkamp Tested-by: kokoro Commit-Queue: Dennis Kempin --- common/cros_async/src/uring_source.rs | 4 ++-- tools/clippy | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/common/cros_async/src/uring_source.rs b/common/cros_async/src/uring_source.rs index 00fc04c0cc..089bf64aa0 100644 --- a/common/cros_async/src/uring_source.rs +++ b/common/cros_async/src/uring_source.rs @@ -237,7 +237,7 @@ mod tests { // Use guest memory as a test file, it implements AsRawFd. let mut source = tempfile().unwrap(); let data = vec![0x55; 8192]; - source.write(&data).unwrap(); + source.write_all(&data).unwrap(); let io_obj = UringSource::new(source, &ex).unwrap(); @@ -390,7 +390,7 @@ mod tests { Either::Right((5, pending)) => { // Write to the pipe so that the kernel will release the memory associated with // the uring read operation. - w.write(&[0]).expect("failed to write to pipe"); + w.write_all(&[0]).expect("failed to write to pipe"); ::std::mem::drop(pending); } _ => panic!("unexpected select result"), diff --git a/tools/clippy b/tools/clippy index f602ca18eb..5074c0150c 100755 --- a/tools/clippy +++ b/tools/clippy @@ -12,10 +12,6 @@ set -e cd "$(dirname $0)/.." -EXCLUDE_COMMON=( - common/cros_async # 8 errors -) - # Note: Clippy checks are configured in .cargo/config.toml echo "Clippy crosvm workspace" cargo clippy \ @@ -25,8 +21,7 @@ cargo clippy \ "$@" -- -Dwarnings for crate in common/*; do - if [ -d "${crate}" ] && - [[ ! " ${EXCLUDE_COMMON[*]} " =~ " ${crate} " ]]; then + if [ -d "${crate}" ]; then echo "" echo "Clippy ${crate}" (cd "${crate}" &&