Skip to content

Commit

Permalink
fixing error std::fs::read_to_string example documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
haydonryan committed Dec 11, 2023
1 parent 0e2dac8 commit 547f3ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,11 @@ 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 Error>> {
/// let foo: SocketAddr = fs::read_to_string("address.txt")?.parse()?;
/// let address: String = fs::read_to_string("address.txt")?;
/// println!("{}", address);
/// Ok(())
/// }
/// ```
Expand Down

0 comments on commit 547f3ce

Please sign in to comment.