Skip to content

Commit

Permalink
rust updates
Browse files Browse the repository at this point in the history
- cargo update
- feature updates
- Change AsPath to AsRef<Path>

Still aborts on src/lib.rs, rust-lang/rust#23649
  • Loading branch information
cuviper committed Mar 30, 2015
1 parent db151bc commit 261768a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 49 deletions.
78 changes: 39 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ test = false
doc = false

[dependencies]
fuse = "0"
#fuse = "0"
git2 = "0"
probe = "0"
time = "0"

#[dependencies.fuse]
#git = "https://github.com/zargony/rust-fuse"
[dependencies.fuse]
git = "https://github.com/zargony/rust-fuse"
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! # GitFS: a FUSE filesystem for Git objects
#![feature(asm)]
#![feature(core)]
#![feature(convert)]
#![feature(libc)]
#![feature(std_misc)]

Expand All @@ -30,7 +30,7 @@ use std::default::Default;
use std::ffi::{OsString, AsOsStr};
use std::os::unix::ffi::OsStrExt;
use std::fs;
use std::path::{AsPath, Path, PathBuf};
use std::path::{Path, PathBuf};
use std::u64;

use inode::{Id, InodeContainer, InodeMapper};
Expand Down Expand Up @@ -76,26 +76,26 @@ impl GitFS {
}

fn mount_options(&self) -> OsString {
let mut options = OsString::from_str("-oro,default_permissions,fsname=");
let mut options = OsString::from("-oro,default_permissions,fsname=");
options.push(&self.repo.path()); // FIXME escape commas?
options
}

/// Mount the filesystem and wait until the path is unmounted, e.g. with the command
/// `fusermount -u PATH`.
pub fn mount<P: AsPath>(mut self, mountpoint: &P) {
pub fn mount<P: AsRef<Path>>(mut self, mountpoint: &P) {
// Create/remove the mount point if it doesn't exist
self.mountdir = DirHandle::new(mountpoint.as_path());
self.mountdir = DirHandle::new(mountpoint.as_ref());

let options = self.mount_options();
fuse::mount(self, mountpoint, &[&options])
}

/// Mount the filesystem in the background. It will remain mounted until the returned session
/// object is dropped, or an external umount is issued.
pub fn spawn_mount<P: AsPath>(mut self, mountpoint: &P) -> std::io::Result<fuse::BackgroundSession> {
pub fn spawn_mount<P: AsRef<Path>>(mut self, mountpoint: &P) -> std::io::Result<fuse::BackgroundSession> {
// Create/remove the mount point if it doesn't exist
self.mountdir = DirHandle::new(mountpoint.as_path());
self.mountdir = DirHandle::new(mountpoint.as_ref());

let options = self.mount_options();
fuse::spawn_mount(self, mountpoint, &[&options])
Expand Down

0 comments on commit 261768a

Please sign in to comment.