fn main() { use std::io::{self, Write}; let line: &[u8] = b" key = some value "; let body = line.trim_ascii(); let eq = body.iter().position(|&b| b == b'=').unwrap(); let mut out = io::stdout().lock(); out.write_all(b"'").unwrap(); out.write_all(body[..eq].trim_ascii()).unwrap(); out.write_all(b"' -> '").unwrap(); out.write_all(body[eq + 1..].trim_ascii()).unwrap(); out.write_all(b"'\n").unwrap(); }