format-buf

Drop-in replacement for format! macro, which can write to existing buffer

APACHE-2.0 License

Downloads
308.9K
Stars
5
Committers
1

Overview

A drop-in replacement for std::format!, which can optionally accept an existing String buffer.

use format_buf::format;

let mut buf = format!("Roses are {},\n", "red");
let () = format!(buf, "Violets are {}.", "blue");
assert_eq!(buf, "\
    Roses are red,\n\
    Violets are blue.\
")