File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -358,25 +358,24 @@ impl File {
358
358
///
359
359
/// It is equivalent to `OpenOptions::new()` but allows you to write more
360
360
/// 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
362
362
/// also avoids the need to import `OpenOptions`.
363
363
///
364
364
/// See the [`OpenOptions::new`] function for more details.
365
365
///
366
366
/// # Examples
367
367
///
368
368
/// ```no_run
369
- /// #![feature(with_options)]
370
369
/// use std::fs::File;
371
370
///
372
371
/// 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")?;
374
373
/// Ok(())
375
374
/// }
376
375
/// ```
377
376
#[ 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 {
380
379
OpenOptions :: new ( )
381
380
}
382
381
You can’t perform that action at this time.
0 commit comments