Skip to content

Commit

Permalink
Rollup merge of #119153 - rursprung:stabilize-file_create_new, r=dtolnay
Browse files Browse the repository at this point in the history
stabilize `file_create_new`

closes #105135
  • Loading branch information
matthiaskrgr authored Dec 23, 2023
2 parents 5459247 + 62d5321 commit b136919
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 b136919

Please sign in to comment.