Skip to content

Commit

Permalink
stabilize file_create_new
Browse files Browse the repository at this point in the history
closes #105135
  • Loading branch information
rursprung committed Dec 20, 2023
1 parent 5810dee commit 62d5321
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,6 @@ impl File {
/// # Examples
///
/// ```no_run
/// #![feature(file_create_new)]
///
/// use std::fs::File;
/// use std::io::Write;
///
Expand All @@ -422,7 +420,7 @@ impl File {
/// Ok(())
/// }
/// ```
#[unstable(feature = "file_create_new", issue = "105135")]
#[stable(feature = "file_create_new", since = "CURRENT_RUSTC_VERSION")]
pub fn create_new<P: AsRef<Path>>(path: P) -> io::Result<File> {
OpenOptions::new().read(true).write(true).create_new(true).open(path.as_ref())
}
Expand Down

0 comments on commit 62d5321

Please sign in to comment.