From d75eb0fef951d0c09e3d42484e513b97dbb6749c Mon Sep 17 00:00:00 2001 From: Be Date: Fri, 7 Feb 2025 21:14:15 -0600 Subject: [PATCH] document that async File & Volume must be explicitly closed --- src/inner/filesystem/files.rs | 3 +++ src/inner/mod.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/inner/filesystem/files.rs b/src/inner/filesystem/files.rs index ff9e022..594e417 100644 --- a/src/inner/filesystem/files.rs +++ b/src/inner/filesystem/files.rs @@ -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, diff --git a/src/inner/mod.rs b/src/inner/mod.rs index 3f3d92f..3cf4631 100644 --- a/src/inner/mod.rs +++ b/src/inner/mod.rs @@ -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,