#buffer #format #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 #buf

Download history 68/week @ 2024-07-22 42/week @ 2024-07-29 55/week @ 2024-08-05 69/week @ 2024-08-12 87/week @ 2024-08-19 85/week @ 2024-08-26 100/week @ 2024-09-02 76/week @ 2024-09-09 81/week @ 2024-09-16 95/week @ 2024-09-23 55/week @ 2024-09-30 23/week @ 2024-10-07 42/week @ 2024-10-14 45/week @ 2024-10-21 134/week @ 2024-10-28 78/week @ 2024-11-04

300 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