Make mount points not require an extra reference

parent 86b0d612
Pipeline #5330 passed with stages
in 2 minutes and 26 seconds
......@@ -20,7 +20,7 @@ const TTL: Timespec = Timespec { sec: 1, nsec: 0 }; // 1 second
const NULL_TIME: Timespec = Timespec { sec: 0, nsec: 0 };
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: filesystem::FileSystem<D>, mountpoint: &P, mut callback: F, options: &[&OsStr]) -> io::Result<()> {
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: filesystem::FileSystem<D>, mountpoint: P, mut callback: F, options: &[&OsStr]) -> io::Result<()> {
let mut session = Session::new(Fuse {
fs: filesystem
}, mountpoint.as_ref(), options)?;
......
......@@ -11,7 +11,7 @@ mod fuse;
mod redox;
#[cfg(target_os = "macos")]
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: FileSystem<D>, mountpoint: &P, callback: F) -> io::Result<()> {
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: FileSystem<D>, mountpoint: P, callback: F) -> io::Result<()> {
use std::ffi::OsStr;
fuse::mount(filesystem, mountpoint, callback, &[
......@@ -25,11 +25,11 @@ pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: FileSystem<D>, mou
}
#[cfg(all(not(target_os = "macos"), not(target_os = "redox")))]
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: FileSystem<D>, mountpoint: &P, callback: F) -> io::Result<()> {
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: FileSystem<D>, mountpoint: P, callback: F) -> io::Result<()> {
fuse::mount(filesystem, mountpoint, callback, &[])
}
#[cfg(target_os = "redox")]
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: FileSystem<D>, mountpoint: &P, callback: F) -> io::Result<()> {
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: FileSystem<D>, mountpoint: P, callback: F) -> io::Result<()> {
redox::mount(filesystem, mountpoint, callback)
}
......@@ -14,7 +14,7 @@ use self::scheme::FileScheme;
pub mod resource;
pub mod scheme;
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: FileSystem<D>, mountpoint: &P, mut callback: F) -> io::Result<()> {
pub fn mount<D: Disk, P: AsRef<Path>, F: FnMut()>(filesystem: FileSystem<D>, mountpoint: P, mut callback: F) -> io::Result<()> {
let mountpoint = mountpoint.as_ref();
let mut socket = File::create(format!(":{}", mountpoint.display()))?;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment