Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl Path {
/// assert_eq!(&*ancestors.next().unwrap(), path!("/"));
/// assert!(ancestors.next().is_none());
/// ```
pub fn ancestors(&self) -> Ancestors {
pub fn ancestors(&self) -> Ancestors<'_> {
Ancestors {
path: self.as_str(),
}
Expand All @@ -260,7 +260,7 @@ impl Path {
/// assert_eq!(&*iter.next().unwrap(), path!("file.extension"));
/// assert!(iter.next().is_none());
/// ```
pub fn iter(&self) -> Iter {
pub fn iter(&self) -> Iter<'_> {
Iter {
path: self.as_str(),
}
Expand Down
8 changes: 4 additions & 4 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ impl<'a, Storage: driver::Storage> Filesystem<'a, Storage> {
/// Creates a new, empty directory at the provided path.
pub fn create_dir(&self, path: &Path) -> Result<()> {
#[cfg(test)]
println!("creating {:?}", path);
println!("creating {path:?}");
let return_code =
unsafe { ll::lfs_mkdir(&mut self.alloc.borrow_mut().state, path.as_ptr()) };
result_from((), return_code)
Expand All @@ -1175,7 +1175,7 @@ impl<'a, Storage: driver::Storage> Filesystem<'a, Storage> {
if path_slice[i] == b'/' {
let dir = PathBuf::try_from(&path_slice[..i]).map_err(|_| Error::IO)?;
#[cfg(test)]
println!("generated PathBuf dir {:?} using i = {}", &dir, i);
println!("generated PathBuf dir {dir:?} using i = {i}");
if let Err(error) = self.create_dir(&dir) {
if error != Error::ENTRY_ALREADY_EXISTED {
return Err(error);
Expand Down Expand Up @@ -1246,7 +1246,7 @@ impl<'a, Storage: driver::Storage> Filesystem<'a, Storage> {
/// and will entirely replace its contents if it does.
pub fn write(&self, path: &Path, contents: &[u8]) -> Result<()> {
#[cfg(test)]
println!("writing {:?}", path);
println!("writing {path:?}");
File::create_and_then(self, path, |file| {
use io::Write;
file.write_all(contents)
Expand All @@ -1260,7 +1260,7 @@ impl<'a, Storage: driver::Storage> Filesystem<'a, Storage> {
/// it will fail if the file is not already large enough with regard to the `pos` parameter
pub fn write_chunk(&self, path: &Path, contents: &[u8], pos: OpenSeekFrom) -> Result<()> {
#[cfg(test)]
println!("writing {:?}", path);
println!("writing {path:?}");
OpenOptions::new()
.read(true)
.write(true)
Expand Down