Skip to content

Commit

Permalink
feat: create alias method remove_file
Browse files Browse the repository at this point in the history
  • Loading branch information
Oakchris1955 committed Sep 12, 2024
1 parent 61c83ed commit dbeaf4b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/fat/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,16 @@ impl<'a, S> FileSystem<'a, S>
where
S: Read + Write + Seek,
{
/// Remove a [`RWFile`] from the filesystem
///
/// This is an alias to `self.get_rw_file(path)?.remove()?`
#[inline]
pub fn remove_file(&mut self, path: PathBuf) -> FSResult<(), S::Error> {
self.get_rw_file(path)?.remove()?;

Ok(())
}

/// Get a corresponding [`RWFile`] object from a [`PathBuf`]
///
/// Borrows `&mut self` until that [`RWFile`] object is dropped, effectively locking `self` until that file closed
Expand Down

0 comments on commit dbeaf4b

Please sign in to comment.