Write a simple file.

This commit is contained in:
Eli Ribble 2023-11-29 17:42:35 -07:00
parent 080c248db0
commit 0d3effd9d2
1 changed files with 7 additions and 2 deletions

View File

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