Crates.io | format-buf |
lib.rs | format-buf |
version | 1.0.0 |
source | src |
created_at | 2019-07-20 16:47:11.501885 |
updated_at | 2019-07-20 16:47:11.501885 |
description | Drop-in replacement for format! macro, which can write to existing buffer |
homepage | |
repository | https://github.com/matklad/format-buf |
max_upload_size | |
id | 150383 |
size | 14,575 |
A drop-in replacement for std::format!
, which can optionally accept a 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.\
")