diff --git a/src/fs.rs b/src/fs.rs index 4d4172eb..906a28f3 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -919,7 +919,7 @@ pub struct ReadDir<'a, 'b, S: driver::Storage> { // to the field alloc.state, so we cannot assert unique mutable access. alloc: RefCell<*mut ReadDirAllocation>, fs: &'b Filesystem<'a, S>, - path: PathBuf, + path: &'b Path, } impl<'a, 'b, S: driver::Storage> Iterator for ReadDir<'a, 'b, S> { @@ -1008,7 +1008,7 @@ impl<'a, Storage: driver::Storage> Filesystem<'a, Storage> { pub unsafe fn read_dir<'b>( &'b self, alloc: &'b mut ReadDirAllocation, - path: &Path, + path: &'b Path, ) -> Result> { // ll::lfs_dir_open stores a copy of the pointer to alloc.state, so // we must use addr_of_mut! here, since &mut alloc.state asserts unique @@ -1022,7 +1022,7 @@ impl<'a, Storage: driver::Storage> Filesystem<'a, Storage> { let read_dir = ReadDir { alloc: RefCell::new(alloc), fs: self, - path: PathBuf::from(path), + path, }; result_from(read_dir, return_code)