summary refs log tree commit diff
path: root/src/linux.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/linux.rs')
-rw-r--r--src/linux.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/linux.rs b/src/linux.rs
index 1dbd8fd..762b882 100644
--- a/src/linux.rs
+++ b/src/linux.rs
@@ -488,10 +488,10 @@ fn create_virtio_devs(
         }
     }
 
-    #[cfg(feature = "gpu")]
-    let mut resource_bridge_wl_socket: Option<
-        devices::virtio::resource_bridge::ResourceRequestSocket,
-    > = None;
+    #[cfg_attr(not(feature = "gpu"), allow(unused_mut))]
+    let mut resource_bridge_wl_socket =
+        None::<devices::virtio::resource_bridge::ResourceRequestSocket>;
+
     #[cfg(feature = "gpu")]
     {
         if cfg.gpu {
@@ -591,9 +591,6 @@ fn create_virtio_devs(
         let jailed_wayland_dir = Path::new("/wayland");
         let jailed_wayland_path = jailed_wayland_dir.join(wayland_socket_name);
 
-        #[cfg(not(feature = "gpu"))]
-        let resource_bridge_wl_socket = None;
-
         let wl_box = Box::new(
             devices::virtio::Wl::new(
                 if cfg.multiprocess {