1 2 3 4 5 6 7 8 9 10 11 12
//! cargo run --example replace use file_editor::Editor; use std::path::Path; fn main() -> std::io::Result<()> { let p = Path::new("examples/sandbox/replace.txt"); Editor::create(p)? .append("colour colour colour\n") .replace("colour", "color") .save()?; Ok(()) }