Fix compilation without gvfs feature

This commit is contained in:
Jeremy Soller 2024-04-22 15:32:19 -06:00
parent 2b1abc7c23
commit d80c358ca5
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
2 changed files with 7 additions and 1 deletions

View file

@ -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<MounterKey, Box<dyn Mounter>>;
pub type Mounters = Arc<MounterMap>;
pub fn mounters() -> Mounters {
#[allow(unused_mut)]
let mut mounters = MounterMap::new();
#[cfg(feature = "gvfs")]