File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -358,25 +358,24 @@ impl File {
358358 ///
359359 /// It is equivalent to `OpenOptions::new()` but allows you to write more
360360 /// readable code. Instead of `OpenOptions::new().read(true).open("foo.txt")`
361- /// you can write `File::with_options ().read(true).open("foo.txt")`. This
361+ /// you can write `File::options ().read(true).open("foo.txt")`. This
362362 /// also avoids the need to import `OpenOptions`.
363363 ///
364364 /// See the [`OpenOptions::new`] function for more details.
365365 ///
366366 /// # Examples
367367 ///
368368 /// ```no_run
369- /// #![feature(with_options)]
370369 /// use std::fs::File;
371370 ///
372371 /// fn main() -> std::io::Result<()> {
373- /// let mut f = File::with_options ().read(true).open("foo.txt")?;
372+ /// let mut f = File::options ().read(true).open("foo.txt")?;
374373 /// Ok(())
375374 /// }
376375 /// ```
377376 #[ must_use]
378- #[ unstable ( feature = "with_options" , issue = "65439 " ) ]
379- pub fn with_options ( ) -> OpenOptions {
377+ #[ stable ( feature = "with_options" , since = "1.58.0 " ) ]
378+ pub fn options ( ) -> OpenOptions {
380379 OpenOptions :: new ( )
381380 }
382381
You can’t perform that action at this time.
0 commit comments