From 50740cece43671cc42035f92cde460aad3d29494 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 28 Feb 2020 12:36:56 -0800 Subject: [PATCH] linux: fix unused code warning without gpu feature When the gpu feature is not enabled, the compiler warns about unused imports of DEFAULT_TOUCH_DEVICE_HEIGHT and DEFAULT_TOUCH_DEVICE_WIDTH. Put these imports behind a cfg check to silence the warning. BUG=None TEST=cargo build TEST=emerge-nami crosvm # test with gpu feature enabled Change-Id: Ib60072cc78a8ffd0ac39dcb4d3a60ba4c9d424b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2080645 Reviewed-by: Dylan Reid Tested-by: kokoro Commit-Queue: Daniel Verkamp --- src/linux.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/linux.rs b/src/linux.rs index be2df227c5..007e18e55e 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -62,10 +62,10 @@ use vm_control::{ VmRunMode, }; -use crate::{ - Config, DiskOption, Executable, SharedDir, SharedDirKind, TouchDeviceOption, - DEFAULT_TOUCH_DEVICE_HEIGHT, DEFAULT_TOUCH_DEVICE_WIDTH, -}; +use crate::{Config, DiskOption, Executable, SharedDir, SharedDirKind, TouchDeviceOption}; + +#[cfg(feature = "gpu")] +use crate::{DEFAULT_TOUCH_DEVICE_HEIGHT, DEFAULT_TOUCH_DEVICE_WIDTH}; use arch::{self, LinuxArch, RunnableLinuxVm, VirtioDeviceStub, VmComponents, VmImage};