From 78d30a217f08f1b8e282556f3d9bbf84e84e89be Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sun, 16 Feb 2025 20:22:20 +0000 Subject: [PATCH] doc: clarify "inner file will be deleted" documentation (#329) fixes #203 --- src/file/mod.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/file/mod.rs b/src/file/mod.rs index 5907a79aa..4a3025fb7 100644 --- a/src/file/mod.rs +++ b/src/file/mod.rs @@ -823,9 +823,11 @@ impl NamedTempFile { &mut self.file } - /// Convert the temporary file into a `std::fs::File`. + /// Turn this named temporary file into an "unnamed" temporary file as if you + /// had constructed it with [`tempfile()`]. /// - /// The inner file will be deleted. + /// The underlying file will be removed from the filesystem but the returned [`File`] + /// can still be read/written. pub fn into_file(self) -> F { self.file } @@ -840,8 +842,8 @@ impl NamedTempFile { /// Converts the named temporary file into its constituent parts. /// - /// Note: When the path is dropped, the file is deleted but the file handle - /// is still usable. + /// Note: When the path is dropped, the underlying file will be removed from the filesystem but + /// the returned [`File`] can still be read/written. pub fn into_parts(self) -> (F, TempPath) { (self.file, self.path) }