Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
clean up example on read_to_string
This is the same thing, but simpler.
  • Loading branch information
steveklabnik authored Apr 10, 2021
commit c2f4a5b9f90428b804da08d554f608a9b58c3c05
3 changes: 2 additions & 1 deletion library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,9 @@ pub fn read<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
/// ```no_run
/// use std::fs;
/// use std::net::SocketAddr;
/// use std::error::Error;
///
/// fn main() -> Result<(), Box<dyn std::error::Error + 'static>> {
/// fn main() -> Result<(), Box<dyn Error>> {
/// let foo: SocketAddr = fs::read_to_string("address.txt")?.parse()?;
/// Ok(())
/// }
Expand Down