From c2f4a5b9f90428b804da08d554f608a9b58c3c05 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Sat, 10 Apr 2021 12:50:04 -0500 Subject: [PATCH] clean up example on read_to_string This is the same thing, but simpler. --- library/std/src/fs.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 860bc130b7d8b..e6120b8ee31c2 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -265,8 +265,9 @@ pub fn read>(path: P) -> io::Result> { /// ```no_run /// use std::fs; /// use std::net::SocketAddr; +/// use std::error::Error; /// -/// fn main() -> Result<(), Box> { +/// fn main() -> Result<(), Box> { /// let foo: SocketAddr = fs::read_to_string("address.txt")?.parse()?; /// Ok(()) /// }