std::write! []

( $ dst : expr , $ ( $ arg : tt ) * ) => (
$ dst . write_fmt ( format_args ! ( $ ( $ arg ) * ) ) )

Use the format! syntax to write data into a buffer of type &mut Write. See std::fmt for more information.

Examples

fn main() { use std::io::Write; let mut w = Vec::new(); write!(&mut w, "test").unwrap(); write!(&mut w, "formatted {}", "arguments").unwrap(); }
use std::io::Write;

let mut w = Vec::new();
write!(&mut w, "test").unwrap();
write!(&mut w, "formatted {}", "arguments").unwrap();