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

format-buf

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

1 stable release

1.0.0 Jul 20, 2019

#2394 in Rust patterns

Download history 2037/week @ 2023-11-27 1135/week @ 2023-12-04 922/week @ 2023-12-11 1275/week @ 2023-12-18 210/week @ 2023-12-25 375/week @ 2024-01-01 844/week @ 2024-01-08 1002/week @ 2024-01-15 832/week @ 2024-01-22 1256/week @ 2024-01-29 1111/week @ 2024-02-05 713/week @ 2024-02-12 1099/week @ 2024-02-19 963/week @ 2024-02-26 651/week @ 2024-03-04 266/week @ 2024-03-11

3,001 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