Skip to content

Commit 547f3ce

Browse files
committed
fixing error std::fs::read_to_string example documentation
1 parent 0e2dac8 commit 547f3ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/std/src/fs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,11 @@ pub fn read<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
283283
///
284284
/// ```no_run
285285
/// use std::fs;
286-
/// use std::net::SocketAddr;
287286
/// use std::error::Error;
288287
///
289288
/// fn main() -> Result<(), Box<dyn Error>> {
290-
/// let foo: SocketAddr = fs::read_to_string("address.txt")?.parse()?;
289+
/// let address: String = fs::read_to_string("address.txt")?;
290+
/// println!("{}", address);
291291
/// Ok(())
292292
/// }
293293
/// ```

0 commit comments

Comments
 (0)