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 <nkgold@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
This commit is contained in:
Dennis Kempin 2022-02-07 11:29:09 -08:00 committed by Commit Bot
parent 04ccba5143
commit 5eb7743abd
2 changed files with 3 additions and 8 deletions

View file

@ -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"),

View file

@ -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}" &&