9个版本
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.0 | 2019年4月20日 |
#310 在 进程宏 中
每月399次下载
在 7 个库中使用 (通过 enso-prelude)
8KB
52 行
ifmt
一个小的库,将内联字符串插值引入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许可证,任选其一。
lib.rs
:
一个小的库,将内联字符串插值引入Rust的标准格式化宏。
示例
use ifmt::iprintln;
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!
依赖
~3.5–4.5MB
~88K SLoC