Skip to content

Commit

Permalink
document that async File & Volume must be explicitly closed
Browse files Browse the repository at this point in the history
  • Loading branch information
Be-ing committed Feb 12, 2025
1 parent 42ad016 commit d75eb0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/inner/filesystem/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ impl RawFile {
/// If you drop a value of this type, it closes the file automatically, and but
/// error that may occur will be ignored. To handle potential errors, use
/// the [`File::close`] method.
///
/// For async Files, async drop does not exist in Rust, so you *must* call
/// [`File::close`] when you are done with a File.
pub struct File<'a, D, T, const MAX_DIRS: usize, const MAX_FILES: usize, const MAX_VOLUMES: usize>
where
D: BlockDevice,
Expand Down
3 changes: 3 additions & 0 deletions src/inner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ impl RawVolume {
/// If you drop a value of this type, it closes the volume automatically, but
/// any error that may occur will be ignored. To handle potential errors, use
/// the [`Volume::close`] method.
///
/// For async Volumes, async drop does not exist in Rust, so you *must* call
/// [`Volume::close`] when you are done with a Volume.
pub struct Volume<'a, D, T, const MAX_DIRS: usize, const MAX_FILES: usize, const MAX_VOLUMES: usize>
where
D: BlockDevice,
Expand Down

0 comments on commit d75eb0f

Please sign in to comment.