fn main() { use std::io::{self, Write}; let mut s: Vec = Vec::new(); s.extend_from_slice(b"hello"); s.push(b','); write!(&mut s, " world! {}", 6 * 7).unwrap(); let mut out = io::stdout().lock(); out.write_all(&s).unwrap(); writeln!(&mut out, " [{} bytes]", s.len()).unwrap(); }