summary refs log tree commit diff
path: root/devices/src
diff options
context:
space:
mode:
authorJianxun Zhang <jianxun.zhang@intel.com>2019-08-07 15:18:48 -0700
committerCommit Bot <commit-bot@chromium.org>2019-08-09 01:00:57 +0000
commitb600dd5bec5790af1f8f935ac12dab5beb829819 (patch)
treed542ac9d4554f508d4ae6da8d1736fe6147ebbc0 /devices/src
parent0f2cfb095dc2d49bfe22cb2d560b7777a19901e8 (diff)
downloadcrosvm-b600dd5bec5790af1f8f935ac12dab5beb829819.tar
crosvm-b600dd5bec5790af1f8f935ac12dab5beb829819.tar.gz
crosvm-b600dd5bec5790af1f8f935ac12dab5beb829819.tar.bz2
crosvm-b600dd5bec5790af1f8f935ac12dab5beb829819.tar.lz
crosvm-b600dd5bec5790af1f8f935ac12dab5beb829819.tar.xz
crosvm-b600dd5bec5790af1f8f935ac12dab5beb829819.tar.zst
crosvm-b600dd5bec5790af1f8f935ac12dab5beb829819.zip
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 <jianxun.zhang@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1742921
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'devices/src')
-rw-r--r--devices/src/virtio/input/event_source.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/devices/src/virtio/input/event_source.rs b/devices/src/virtio/input/event_source.rs
index 333928b..7ca7e13 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<u8>,
@@ -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]);