Skip to content

Commit 9f7e20b

Browse files
authored
Rollup merge of #100337 - camelid:stabilize-io_read_to_string, r=JohnTitor
Stabilize `std::io::read_to_string` Closes #80218. 🎉 This PR stabilizes the `std::io::read_to_string` function, with the following public API: ```rust pub fn read_to_string<R: Read>(reader: R) -> Result<String>; ``` It's analogous to `std::fs::read_to_string` for files, but it works on anything that implements `io::Read`, including `io::stdin()`. See the tracking issue (#80218) or documentation for details.
2 parents 3ea5456 + 2df5afe commit 9f7e20b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

library/std/src/io/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1037,8 +1037,6 @@ pub trait Read {
10371037
/// # Examples
10381038
///
10391039
/// ```no_run
1040-
/// #![feature(io_read_to_string)]
1041-
///
10421040
/// # use std::io;
10431041
/// fn main() -> io::Result<()> {
10441042
/// let stdin = io::read_to_string(io::stdin())?;
@@ -1047,7 +1045,7 @@ pub trait Read {
10471045
/// Ok(())
10481046
/// }
10491047
/// ```
1050-
#[unstable(feature = "io_read_to_string", issue = "80218")]
1048+
#[stable(feature = "io_read_to_string", since = "CURRENT_RUSTC_VERSION")]
10511049
pub fn read_to_string<R: Read>(mut reader: R) -> Result<String> {
10521050
let mut buf = String::new();
10531051
reader.read_to_string(&mut buf)?;

0 commit comments

Comments
 (0)