#format #buffer #replace #buf #drop-in #write #macro

format-buf

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

1 stable release

1.0.0 Jul 20, 2019

#12 in #drop-in

Download history 37/week @ 2024-11-15 59/week @ 2024-11-22 59/week @ 2024-11-29 75/week @ 2024-12-06 88/week @ 2024-12-13 56/week @ 2024-12-20 17/week @ 2024-12-27 39/week @ 2025-01-03 71/week @ 2025-01-10 55/week @ 2025-01-17 675/week @ 2025-01-24 224/week @ 2025-01-31 115/week @ 2025-02-07 59/week @ 2025-02-14 97/week @ 2025-02-21 63/week @ 2025-02-28

449 downloads per month

MIT/Apache

6KB

Build Status Crates.io API reference

Overview

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.\
")

No runtime deps