fs::write: Add example writing a &str

This commit is contained in:
Aaron DeVore
2018-05-10 11:47:31 -07:00
committed by Mark Simulacrum
parent 575ac946bc
commit bf6804b79c

View File

@@ -331,6 +331,7 @@ pub fn read_to_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
/// ///
/// fn main() -> std::io::Result<()> { /// fn main() -> std::io::Result<()> {
/// fs::write("foo.txt", b"Lorem ipsum")?; /// fs::write("foo.txt", b"Lorem ipsum")?;
/// fs::write("bar.txt", "dolor sit")?;
/// Ok(()) /// Ok(())
/// } /// }
/// ``` /// ```