fixing error std::fs::read_to_string example documentation
This commit is contained in:
parent
0e2dac8375
commit
547f3cef60
1 changed files with 2 additions and 2 deletions
|
|
@ -283,11 +283,11 @@ 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 Error>> {
|
||||
/// let foo: SocketAddr = fs::read_to_string("address.txt")?.parse()?;
|
||||
/// let address: String = fs::read_to_string("address.txt")?;
|
||||
/// println!("{}", address);
|
||||
/// Ok(())
|
||||
/// }
|
||||
/// ```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue