Crates.io | ifmt |
lib.rs | ifmt |
version | 0.3.3 |
source | src |
created_at | 2019-04-20 08:17:10.562007 |
updated_at | 2021-01-06 19:39:08.141659 |
description | Inline expression interpolation for Rust. |
homepage | |
repository | https://github.com/ct-austin/ifmt |
max_upload_size | |
id | 129070 |
size | 16,857 |
A small crate which brings inline string interpolation to rust's standard formatting macros.
To use ifmt in your project, add
[dependencies]
ifmt = "0.3.3"
to your Cargo.toml.
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!
This project is licensed under the MIT license or the Apache 2.0 license at your option.