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

format-buf

format!宏的替换方案,可以写入现有的缓冲区

1个稳定版本

1.0.0 2019年7月20日

#10 in #drop-in

Download history 607/week @ 2024-04-11 682/week @ 2024-04-18 859/week @ 2024-04-25 554/week @ 2024-05-02 113/week @ 2024-05-09 175/week @ 2024-05-16 146/week @ 2024-05-23 116/week @ 2024-05-30 153/week @ 2024-06-06 88/week @ 2024-06-13 78/week @ 2024-06-20 95/week @ 2024-06-27 48/week @ 2024-07-04 84/week @ 2024-07-11 81/week @ 2024-07-18 40/week @ 2024-07-25

每月257次下载

MIT/Apache

6KB

Build Status Crates.io API reference

概述

std::format!的替换方案,可选地接受一个现有的String缓冲区。

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

无运行时依赖