7 releases

0.3.3 Jan 6, 2021
0.3.2 Sep 9, 2020
0.3.0 Jan 13, 2020
0.2.0 Jun 6, 2019
0.1.3 May 26, 2019

#12 in #string-interpolation

Download history 118/week @ 2024-04-08 103/week @ 2024-04-15 137/week @ 2024-04-22 115/week @ 2024-04-29 98/week @ 2024-05-06 90/week @ 2024-05-13 150/week @ 2024-05-20 148/week @ 2024-05-27 79/week @ 2024-06-03 68/week @ 2024-06-10 136/week @ 2024-06-17 147/week @ 2024-06-24 76/week @ 2024-07-01 156/week @ 2024-07-08 40/week @ 2024-07-15 55/week @ 2024-07-22

334 downloads per month
Used in 8 crates (via ifmt)

MIT/Apache

17KB
335 lines

ifmt

A small crate which brings inline string interpolation to rust's standard formatting macros.

Getting started

To use ifmt in your project, add

[dependencies]
ifmt = "0.3.3"

to your Cargo.toml.

Examples

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)

Supported macros

format!      -> iformat!
print!       -> iprint!
println!     -> iprintln!
eprint!      -> ieprint!
eprintln!    -> ieprintln!
write!       -> iwrite!
writeln!     -> iwriteln!
panic!       -> ipanic!
format_args! -> iformat_args!

License

This project is licensed under the MIT license or the Apache 2.0 license at your option.

Dependencies

~3.5–4.5MB
~89K SLoC