7 个版本
0.3.3 | 2021年1月6日 |
---|---|
0.3.2 | 2020年9月9日 |
0.3.0 | 2020年1月13日 |
0.2.0 | 2019年6月6日 |
0.1.3 | 2019年5月26日 |
#12 in #字符串插值
每月下载量372
在 8 个crate中(通过 ifmt)使用
17KB
335 行
ifmt
一个小crate,可以将内联字符串插值带到Rust的标准格式化宏中。
入门指南
要在项目中使用ifmt,请将以下内容添加到您的Cargo.toml中:
[dependencies]
ifmt = "0.3.3"
...
示例
let four = 4;
iprintln!("four plus four is: " four + 4);
// four plus four is: 8
iprintln!("here's a hex number: 0x" 0xb0bi64 * 1321517i64 ;x);
// here's a hex number: 0xdeadbeef
iprintln!("here's a debugging value: " Some(four);?);
// here's a debugging value: Some(4)
支持的宏
format! -> iformat!
print! -> iprint!
println! -> iprintln!
eprint! -> ieprint!
eprintln! -> ieprintln!
write! -> iwrite!
writeln! -> iwriteln!
panic! -> ipanic!
format_args! -> iformat_args!
许可证
此项目根据您的选择受MIT许可证或Apache 2.0许可证的许可。
依赖项
~3–4.5MB
~87K SLoC