Write a simple file.
This commit is contained in:
parent
080c248db0
commit
0d3effd9d2
1 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
fn main() {
|
||||
println!("Hello World!");
|
||||
use std::fs::File;
|
||||
use std::io::prelude::*;
|
||||
|
||||
fn main() -> std::io::Result<()>{
|
||||
let mut file = File::create("foo.txt")?;
|
||||
file.write_all(b"Hello, world!")?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue