Skip to content

Commit c2f4a5b

Browse files
authored
clean up example on read_to_string
This is the same thing, but simpler.
1 parent 4029d4d commit c2f4a5b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/std/src/fs.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,9 @@ pub fn read<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
265265
/// ```no_run
266266
/// use std::fs;
267267
/// use std::net::SocketAddr;
268+
/// use std::error::Error;
268269
///
269-
/// fn main() -> Result<(), Box<dyn std::error::Error + 'static>> {
270+
/// fn main() -> Result<(), Box<dyn Error>> {
270271
/// let foo: SocketAddr = fs::read_to_string("address.txt")?.parse()?;
271272
/// Ok(())
272273
/// }

0 commit comments

Comments
 (0)