Skip to content

Commit

Permalink
clean up example on read_to_string
Browse files Browse the repository at this point in the history
This is the same thing, but simpler.
  • Loading branch information
steveklabnik authored Apr 10, 2021
1 parent 4029d4d commit c2f4a5b
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit c2f4a5b

Please sign in to comment.