Skip to content

Commit 06eb90e

Browse files
authored
Rollup merge of rust-lang#98662 - LucasDumont:document_fs_write, r=thomcc
Add std::fs::write documentation precision Fixes rust-lang#97947. As mentioned in rust-lang#97947, the documentation is updated
2 parents bf9ed99 + 07a0fd2 commit 06eb90e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/std/src/fs.rs

+6
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ pub fn read_to_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
295295
/// This function will create a file if it does not exist,
296296
/// and will entirely replace its contents if it does.
297297
///
298+
/// Depending on the platform, this function may fail if the
299+
/// full directory path does not exist.
300+
///
298301
/// This is a convenience function for using [`File::create`] and [`write_all`]
299302
/// with fewer imports.
300303
///
@@ -349,6 +352,9 @@ impl File {
349352
/// This function will create a file if it does not exist,
350353
/// and will truncate it if it does.
351354
///
355+
/// Depending on the platform, this function may fail if the
356+
/// full directory path does not exist.
357+
///
352358
/// See the [`OpenOptions::open`] function for more details.
353359
///
354360
/// # Examples

0 commit comments

Comments
 (0)