From d80c358ca55f63a779949fb7104fed285520cf58 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 22 Apr 2024 15:32:19 -0600 Subject: [PATCH] Fix compilation without gvfs feature --- src/mounter/gvfs.rs | 1 - src/mounter/mod.rs | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mounter/gvfs.rs b/src/mounter/gvfs.rs index ff9fad1..d062544 100644 --- a/src/mounter/gvfs.rs +++ b/src/mounter/gvfs.rs @@ -163,7 +163,6 @@ impl Gvfs { event_tx.send(Event::Items(items)).unwrap(); } Cmd::Mount(mounter_item) => { - #[allow(irrefutable_let_patterns)] let MounterItem::Gvfs(item) = mounter_item else { continue }; let ItemKind::Volume = item.kind else { continue }; for (i, volume) in monitor.volumes().into_iter().enumerate() { diff --git a/src/mounter/mod.rs b/src/mounter/mod.rs index 3c4b106..0be732f 100644 --- a/src/mounter/mod.rs +++ b/src/mounter/mod.rs @@ -8,6 +8,8 @@ mod gvfs; pub enum MounterItem { #[cfg(feature = "gvfs")] Gvfs(gvfs::Item), + #[allow(dead_code)] + None, } impl MounterItem { @@ -15,6 +17,7 @@ impl MounterItem { match self { #[cfg(feature = "gvfs")] Self::Gvfs(item) => item.name(), + Self::None => unreachable!(), } } @@ -22,6 +25,7 @@ impl MounterItem { match self { #[cfg(feature = "gvfs")] Self::Gvfs(item) => item.is_mounted(), + Self::None => unreachable!(), } } @@ -29,6 +33,7 @@ impl MounterItem { match self { #[cfg(feature = "gvfs")] Self::Gvfs(item) => item.icon(), + Self::None => unreachable!(), } } @@ -36,6 +41,7 @@ impl MounterItem { match self { #[cfg(feature = "gvfs")] Self::Gvfs(item) => item.path(), + Self::None => unreachable!(), } } } @@ -54,6 +60,7 @@ pub type MounterMap = BTreeMap>; pub type Mounters = Arc; pub fn mounters() -> Mounters { + #[allow(unused_mut)] let mut mounters = MounterMap::new(); #[cfg(feature = "gvfs")]