From 6f9215cecd81947cb5c42e5ad43e1470f7e4e802 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 20 Aug 2019 09:41:22 -0700 Subject: [PATCH] crosvm: silence unused code warning for NonZeroU8 After a recent refactoring of display support, this import is only used when building with the "gpu" feature enabled. Put it behind a cfg check to avoid a warning when building without gpu support. BUG=None TEST=cargo build TEST=emerge-nami crosvm Change-Id: I4e407e09daa93c74203f3472dad5a3713b99d122 Signed-off-by: Daniel Verkamp Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1762448 Reviewed-by: Zach Reizner Tested-by: kokoro --- src/linux.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/linux.rs b/src/linux.rs index b579e8ab6f..75b09b5239 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -11,6 +11,7 @@ use std::fmt::{self, Display}; use std::fs::{File, OpenOptions}; use std::io::{self, stdin, Read}; use std::net::Ipv4Addr; +#[cfg(feature = "gpu")] use std::num::NonZeroU8; use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; use std::os::unix::net::UnixStream;