This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,10 @@ impl File {
334334 ///
335335 /// See the [`OpenOptions::open`] method for more details.
336336 ///
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+ ///
337341 /// # Errors
338342 ///
339343 /// This function will return an error if `path` does not already exist.
@@ -364,9 +368,11 @@ impl File {
364368 ///
365369 /// Depending on the platform, this function may fail if the
366370 /// full directory path does not exist.
367- ///
368371 /// See the [`OpenOptions::open`] function for more details.
369372 ///
373+ /// See also [`std::fs::write()`][self::write] for a simple function to
374+ /// create a file with a given data.
375+ ///
370376 /// # Examples
371377 ///
372378 /// ```no_run
@@ -975,6 +981,9 @@ impl OpenOptions {
975981 /// In order for the file to be created, [`OpenOptions::write`] or
976982 /// [`OpenOptions::append`] access must be used.
977983 ///
984+ /// See also [`std::fs::write()`][self::write] for a simple function to
985+ /// create a file with a given data.
986+ ///
978987 /// # Examples
979988 ///
980989 /// ```no_run
You can’t perform that action at this time.
0 commit comments