diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2021-04-10 12:50:04 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-10 12:50:04 -0500 |
| commit | c2f4a5b9f90428b804da08d554f608a9b58c3c05 (patch) | |
| tree | 738288ade1071eef2903e0d5b0094044c3436ff2 | |
| parent | 4029d4d0be03b10edccb65588b522ad541b5ccaf (diff) | |
| download | rust-steveklabnik-patch-1.tar.gz | |
clean up example on read_to_stringsteveklabnik-patch-1
This is the same thing, but simpler.
| -rw-r--r-- | library/std/src/fs.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 860bc130b7d..e6120b8ee31 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -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(()) /// } |
