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.
This commit is contained in:
Matthias Krüger 2022-09-04 18:55:43 +02:00 committed by GitHub
commit 8f8a36d1c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@ use crate::sys::fs as fs_imp;
use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
use crate::time::SystemTime;
/// A reference to an open file on the filesystem.
/// An object providing access to an open file on the filesystem.
///
/// An instance of a `File` can be read and/or written depending on what options
/// it was opened with. Files also implement [`Seek`] to alter the logical cursor