diff --git a/Cargo.lock b/Cargo.lock index 18b5dfba1b..283d24e1b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,7 +97,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "redoxfs" -version = "0.3.5" +version = "0.3.6" dependencies = [ "fuse 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index e5f2535f8c..7eb60f4096 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "redoxfs" description = "The Redox Filesystem" repository = "https://gitlab.redox-os.org/redox-os/redoxfs" -version = "0.3.5" +version = "0.3.6" license-file = "LICENSE" readme = "README.md" authors = ["Jeremy Soller "] diff --git a/src/disk/file.rs b/src/disk/file.rs index de1a6fbe96..d36e012c70 100644 --- a/src/disk/file.rs +++ b/src/disk/file.rs @@ -1,5 +1,6 @@ use std::fs::{File, OpenOptions}; use std::io::{Read, Write, Seek, SeekFrom}; +use std::path::Path; use syscall::error::{Error, Result, EIO}; use BLOCK_SIZE; @@ -20,14 +21,14 @@ pub struct DiskFile { } impl DiskFile { - pub fn open(path: &str) -> Result { + pub fn open>(path: P) -> Result { let file = try_disk!(OpenOptions::new().read(true).write(true).open(path)); Ok(DiskFile { file: file }) } - pub fn create(path: &str, size: u64) -> Result { + pub fn create>(path: P, size: u64) -> Result { let file = try_disk!(OpenOptions::new().read(true).write(true).create(true).open(path)); try_disk!(file.set_len(size)); Ok(DiskFile { diff --git a/src/disk/sparse.rs b/src/disk/sparse.rs index dd7d7992cb..da31f06f32 100644 --- a/src/disk/sparse.rs +++ b/src/disk/sparse.rs @@ -1,5 +1,6 @@ use std::fs::{File, OpenOptions}; use std::io::{Read, Write, Seek, SeekFrom}; +use std::path::Path; use std::u64; use syscall::error::{Error, Result, EIO}; @@ -21,7 +22,7 @@ pub struct DiskSparse { } impl DiskSparse { - pub fn create(path: &str) -> Result { + pub fn create>(path: P) -> Result { let file = try_disk!(OpenOptions::new().read(true).write(true).create(true).open(path)); Ok(DiskSparse { file