From b600dd5bec5790af1f8f935ac12dab5beb829819 Mon Sep 17 00:00:00 2001 From: Jianxun Zhang Date: Wed, 7 Aug 2019 15:18:48 -0700 Subject: [PATCH] Fix compiling warnings in test code This change fixes two small warnings in smoke test: Compiling crosvm_plugin v0.17.0 (/platform/crosvm/crosvm_plugin) warning: unused import: `std::mem::size_of` --> devices/src/virtio/input/event_source.rs:292:9 | 292 | use std::mem::size_of; | ^^^^^^^^^^^^^^^^^ | = note: #[warn(unused_imports)] on by default warning: variable does not need to be mutable --> devices/src/virtio/input/event_source.rs:385:13 | 385 | let mut evt_opt = source.pop_available_event(); | ----^^^^^^^ | | | help: remove this `mut` | = note: #[warn(unused_mut)] on by default Compiling arch v0.1.0 (/platform/crosvm/arch) BUG=None TEST=./wrapped_smoke_test.sh Pass smoke test. The 2 warnings disappear in the output. Change-Id: Ib4de48e9586e80087e30411e225265554d5e7a11 Signed-off-by: Jianxun Zhang Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1742921 Reviewed-by: Daniel Verkamp Tested-by: kokoro --- devices/src/virtio/input/event_source.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/devices/src/virtio/input/event_source.rs b/devices/src/virtio/input/event_source.rs index 333928b094..7ca7e13c8d 100644 --- a/devices/src/virtio/input/event_source.rs +++ b/devices/src/virtio/input/event_source.rs @@ -289,7 +289,6 @@ mod tests { use std::cmp::min; use std::io::Read; use std::io::Write; - use std::mem::size_of; struct SourceMock { events: Vec, @@ -382,7 +381,7 @@ mod tests { evts.len(), "should receive all events" ); - let mut evt_opt = source.pop_available_event(); + let evt_opt = source.pop_available_event(); assert_eq!(evt_opt.is_some(), true, "event should have been poped"); let evt = evt_opt.unwrap(); assert_events_match(&evt, &evts[0]);