1 2 3 4 5 6 7 8
use std::fs::File; use std::io::{self, Write}; pub fn write_file(path: &str, content: &str) -> io::Result<()> { let mut file = File::create(path)?; file.write_all(content.as_bytes())?; Ok(()) }