Skip to content

Commit 3e9e325

Browse files
committed
doc: fix and expand File::create explanation
1 parent b63cee4 commit 3e9e325

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libstd/fs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ impl File {
112112
OpenOptions::new().read(true).open(path)
113113
}
114114

115-
/// Creates a open a file in write-only mode.
115+
/// Open a file in write-only mode.
116116
///
117-
/// This method will attempt to open a new file, truncating it if it already
118-
/// exists.
117+
/// This function will create a file it it does not exist,
118+
/// and will truncate it if it does.
119119
///
120120
/// See the `OpenOptions::open` function for more details.
121121
pub fn create<P: AsPath + ?Sized>(path: &P) -> io::Result<File> {

0 commit comments

Comments
 (0)