Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::fs::File;
- use std::io::Read;
- use std::io::Write;
- fn main() {
- let mut data = String::new();
- let mut f = File::open("./README.md").unwrap();
- f.read_to_string(&mut data).unwrap();
- println!("{}", data);
- let mut data2 = format!("hello {}", data);
- let mut f = File::create("./README.md").unwrap();
- f.write_all(&mut data2.as_bytes()).unwrap();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement