9 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.0 Apr 20, 2019

#277 in Procedural macros

Download history 50/week @ 2023-12-04 76/week @ 2023-12-11 59/week @ 2023-12-18 66/week @ 2023-12-25 87/week @ 2024-01-01 352/week @ 2024-01-08 87/week @ 2024-01-15 79/week @ 2024-01-22 87/week @ 2024-01-29 82/week @ 2024-02-05 142/week @ 2024-02-12 90/week @ 2024-02-19 213/week @ 2024-02-26 203/week @ 2024-03-04 353/week @ 2024-03-11 465/week @ 2024-03-18

1,241 downloads per month
Used in 7 crates (via enso-prelude)

MIT/Apache

8KB
52 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.


lib.rs:

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

Examples

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)

Supported macros

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

Dependencies

~3.5–4.5MB
~87K SLoC