fixing error std::fs::read_to_string example documentation

This commit is contained in:
Haydon Ryan 2023-12-11 11:41:33 -06:00
parent 0e2dac8375
commit 547f3cef60

View file

@ -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(())
/// }
/// ```