Skip to content

Commit 6960761

Browse files
committed
Auto merge of #49422 - mbrubeck:fs_read, r=TimNN
Stabilize fs::read and fs::write As discussed in #46588 (comment)
2 parents d8a1bc7 + 0600d0f commit 6960761

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/libstd/fs.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,6 @@ fn initial_buffer_size(file: &File) -> usize {
251251
/// # Examples
252252
///
253253
/// ```no_run
254-
/// #![feature(fs_read_write)]
255-
///
256254
/// use std::fs;
257255
/// use std::net::SocketAddr;
258256
///
@@ -261,7 +259,7 @@ fn initial_buffer_size(file: &File) -> usize {
261259
/// Ok(())
262260
/// }
263261
/// ```
264-
#[unstable(feature = "fs_read_write", issue = "46588")]
262+
#[stable(feature = "fs_read_write_bytes", since = "1.27.0")]
265263
pub fn read<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
266264
let mut file = File::open(path)?;
267265
let mut bytes = Vec::with_capacity(initial_buffer_size(&file));
@@ -325,16 +323,14 @@ pub fn read_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
325323
/// # Examples
326324
///
327325
/// ```no_run
328-
/// #![feature(fs_read_write)]
329-
///
330326
/// use std::fs;
331327
///
332328
/// fn main() -> std::io::Result<()> {
333329
/// fs::write("foo.txt", b"Lorem ipsum")?;
334330
/// Ok(())
335331
/// }
336332
/// ```
337-
#[unstable(feature = "fs_read_write", issue = "46588")]
333+
#[stable(feature = "fs_read_write_bytes", since = "1.27.0")]
338334
pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> io::Result<()> {
339335
File::create(path)?.write_all(contents.as_ref())
340336
}

0 commit comments

Comments
 (0)