Skip to content

Commit 8f8a36d

Browse files
authoredSep 4, 2022
Rollup merge of #101385 - BartMassey-upstream:file-doc, r=thomcc
updated description of File struct in std::fs I've seen several folks confused by the description of `std::fs::File` as "A reference to an open file on the filesystem." Apparently the word `reference` is sometimes taken to mean a Rust `&` reference, leading to confusion. Here's a recent representative [Reddit thread](https://www.reddit.com/r/rust/comments/x4k0lv/comment/imxu7v2/?utm_source=share&utm_medium=web2x&context=3), but I've seen this before as well. This patch changes the description to "An object providing access to an open file on the filesystem." Hopefully this is clearer.
2 parents c4ea4fb + 3afbc11 commit 8f8a36d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎library/std/src/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::sys::fs as fs_imp;
1919
use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
2020
use crate::time::SystemTime;
2121

22-
/// A reference to an open file on the filesystem.
22+
/// An object providing access to an open file on the filesystem.
2323
///
2424
/// An instance of a `File` can be read and/or written depending on what options
2525
/// it was opened with. Files also implement [`Seek`] to alter the logical cursor

0 commit comments

Comments
 (0)