Skip to content

Commit

Permalink
fix: windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Oct 25, 2024
1 parent 2415da5 commit 0786439
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions remotefs-fuse/src/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ impl Mount {
///
/// You can specify the mount options using the `options` parameter.
#[allow(clippy::self_named_constructors)]
#[cfg(unix)]
pub fn mount(driver: Driver, mountpoint: &Path) -> Result<Self, std::io::Error> {
let options = driver
.options
Expand All @@ -26,25 +27,31 @@ impl Mount {
.collect::<Vec<_>>();

Ok(Self {
#[cfg(unix)]
session: Session::new(driver, mountpoint, &options)?,
})
}

#[cfg(windows)]
pub fn mount(driver: Driver, mountpoint: &Path) -> Result<Self, std::io::Error> {
todo!()
}

/// Run the filesystem event loop.
///
/// This function will block the current thread.
pub fn run(&mut self) -> Result<(), std::io::Error> {
#[cfg(unix)]
self.session.run()
self.session.run()?;

Ok(())
}

/// Get a handle to unmount the filesystem.
///
/// To umount see [`Umount::umount`].
pub fn unmounter(&mut self) -> Umount {
#[cfg(unix)]
Umount {
#[cfg(unix)]
umount: self.session.unmount_callable(),
}
}
Expand All @@ -60,6 +67,8 @@ impl Umount {
/// Unmount the filesystem.
pub fn umount(&mut self) -> Result<(), std::io::Error> {
#[cfg(unix)]
self.umount.unmount()
self.umount.unmount()?;

Ok(())
}
}

0 comments on commit 0786439

Please sign in to comment.