]> git.lizzy.rs Git - rust.git/commitdiff
clean up example on read_to_string
authorSteve Klabnik <steve@steveklabnik.com>
Sat, 10 Apr 2021 17:50:04 +0000 (12:50 -0500)
committerGitHub <noreply@github.com>
Sat, 10 Apr 2021 17:50:04 +0000 (12:50 -0500)
This is the same thing, but simpler.

library/std/src/fs.rs

index 860bc130b7d8b7f52c17dc273db2497e5ab15dce..e6120b8ee31c2dc36e13fa2c701d9e2def2133bb 100644 (file)
@@ -265,8 +265,9 @@ fn inner(path: &Path) -> 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(())
 /// }