Skip to content

Commit 78d30a2

Browse files
authored
doc: clarify "inner file will be deleted" documentation (#329)
fixes #203
1 parent 0fe11c4 commit 78d30a2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/file/mod.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -823,9 +823,11 @@ impl<F> NamedTempFile<F> {
823823
&mut self.file
824824
}
825825

826-
/// Convert the temporary file into a `std::fs::File`.
826+
/// Turn this named temporary file into an "unnamed" temporary file as if you
827+
/// had constructed it with [`tempfile()`].
827828
///
828-
/// The inner file will be deleted.
829+
/// The underlying file will be removed from the filesystem but the returned [`File`]
830+
/// can still be read/written.
829831
pub fn into_file(self) -> F {
830832
self.file
831833
}
@@ -840,8 +842,8 @@ impl<F> NamedTempFile<F> {
840842

841843
/// Converts the named temporary file into its constituent parts.
842844
///
843-
/// Note: When the path is dropped, the file is deleted but the file handle
844-
/// is still usable.
845+
/// Note: When the path is dropped, the underlying file will be removed from the filesystem but
846+
/// the returned [`File`] can still be read/written.
845847
pub fn into_parts(self) -> (F, TempPath) {
846848
(self.file, self.path)
847849
}

0 commit comments

Comments
 (0)