提交 517f2402 编写于 作者: B bors

Auto merge of #49521 - mbrubeck:fs_read_write_bytes, r=TimNN

fs_read_write_bytes stabilized in 1.26.0

Fix the stabilization attributes from #49422 because it merged before 1.26 branched to beta.

r? @TimNN
......@@ -259,7 +259,7 @@ fn initial_buffer_size(file: &File) -> usize {
/// Ok(())
/// }
/// ```
#[stable(feature = "fs_read_write_bytes", since = "1.27.0")]
#[stable(feature = "fs_read_write_bytes", since = "1.26.0")]
pub fn read<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
let mut file = File::open(path)?;
let mut bytes = Vec::with_capacity(initial_buffer_size(&file));
......@@ -330,7 +330,7 @@ pub fn read_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
/// Ok(())
/// }
/// ```
#[stable(feature = "fs_read_write_bytes", since = "1.27.0")]
#[stable(feature = "fs_read_write_bytes", since = "1.26.0")]
pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> io::Result<()> {
File::create(path)?.write_all(contents.as_ref())
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册