rust append x code example
Example: append to file rust
// don't forget importing this
use std::io::Write;
let mut file = fs::OpenOptions::new()
.write(true)
.append(true)
.open("file.txt")
.unwrap();
file.write_all(b"to append");
// or
write!(file, "to append");