File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,10 @@ impl File {
334
334
///
335
335
/// See the [`OpenOptions::open`] method for more details.
336
336
///
337
+ /// If you only need to read the entire file contents,
338
+ /// consider [`std::fs::read()`][self::read] or
339
+ /// [`std::fs::read_to_string()`][self::read_to_string] instead.
340
+ ///
337
341
/// # Errors
338
342
///
339
343
/// This function will return an error if `path` does not already exist.
@@ -364,9 +368,11 @@ impl File {
364
368
///
365
369
/// Depending on the platform, this function may fail if the
366
370
/// full directory path does not exist.
367
- ///
368
371
/// See the [`OpenOptions::open`] function for more details.
369
372
///
373
+ /// See also [`std::fs::write()`][self::write] for a simple function to
374
+ /// create a file with a given data.
375
+ ///
370
376
/// # Examples
371
377
///
372
378
/// ```no_run
@@ -975,6 +981,9 @@ impl OpenOptions {
975
981
/// In order for the file to be created, [`OpenOptions::write`] or
976
982
/// [`OpenOptions::append`] access must be used.
977
983
///
984
+ /// See also [`std::fs::write()`][self::write] for a simple function to
985
+ /// create a file with a given data.
986
+ ///
978
987
/// # Examples
979
988
///
980
989
/// ```no_run
You can’t perform that action at this time.
0 commit comments