Fix compilation without gvfs feature
This commit is contained in:
parent
2b1abc7c23
commit
d80c358ca5
2 changed files with 7 additions and 1 deletions
|
|
@ -163,7 +163,6 @@ impl Gvfs {
|
||||||
event_tx.send(Event::Items(items)).unwrap();
|
event_tx.send(Event::Items(items)).unwrap();
|
||||||
}
|
}
|
||||||
Cmd::Mount(mounter_item) => {
|
Cmd::Mount(mounter_item) => {
|
||||||
#[allow(irrefutable_let_patterns)]
|
|
||||||
let MounterItem::Gvfs(item) = mounter_item else { continue };
|
let MounterItem::Gvfs(item) = mounter_item else { continue };
|
||||||
let ItemKind::Volume = item.kind else { continue };
|
let ItemKind::Volume = item.kind else { continue };
|
||||||
for (i, volume) in monitor.volumes().into_iter().enumerate() {
|
for (i, volume) in monitor.volumes().into_iter().enumerate() {
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ mod gvfs;
|
||||||
pub enum MounterItem {
|
pub enum MounterItem {
|
||||||
#[cfg(feature = "gvfs")]
|
#[cfg(feature = "gvfs")]
|
||||||
Gvfs(gvfs::Item),
|
Gvfs(gvfs::Item),
|
||||||
|
#[allow(dead_code)]
|
||||||
|
None,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MounterItem {
|
impl MounterItem {
|
||||||
|
|
@ -15,6 +17,7 @@ impl MounterItem {
|
||||||
match self {
|
match self {
|
||||||
#[cfg(feature = "gvfs")]
|
#[cfg(feature = "gvfs")]
|
||||||
Self::Gvfs(item) => item.name(),
|
Self::Gvfs(item) => item.name(),
|
||||||
|
Self::None => unreachable!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -22,6 +25,7 @@ impl MounterItem {
|
||||||
match self {
|
match self {
|
||||||
#[cfg(feature = "gvfs")]
|
#[cfg(feature = "gvfs")]
|
||||||
Self::Gvfs(item) => item.is_mounted(),
|
Self::Gvfs(item) => item.is_mounted(),
|
||||||
|
Self::None => unreachable!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -29,6 +33,7 @@ impl MounterItem {
|
||||||
match self {
|
match self {
|
||||||
#[cfg(feature = "gvfs")]
|
#[cfg(feature = "gvfs")]
|
||||||
Self::Gvfs(item) => item.icon(),
|
Self::Gvfs(item) => item.icon(),
|
||||||
|
Self::None => unreachable!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,6 +41,7 @@ impl MounterItem {
|
||||||
match self {
|
match self {
|
||||||
#[cfg(feature = "gvfs")]
|
#[cfg(feature = "gvfs")]
|
||||||
Self::Gvfs(item) => item.path(),
|
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 type Mounters = Arc<MounterMap>;
|
||||||
|
|
||||||
pub fn mounters() -> Mounters {
|
pub fn mounters() -> Mounters {
|
||||||
|
#[allow(unused_mut)]
|
||||||
let mut mounters = MounterMap::new();
|
let mut mounters = MounterMap::new();
|
||||||
|
|
||||||
#[cfg(feature = "gvfs")]
|
#[cfg(feature = "gvfs")]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue