| Crates.io | macros-rs |
| lib.rs | macros-rs |
| version | 1.4.1 |
| created_at | 2023-04-20 23:27:52.476117+00 |
| updated_at | 2024-09-10 02:26:56.563537+00 |
| description | simple & useful macros |
| homepage | |
| repository | https://git.furry.win/crates/macros |
| max_upload_size | |
| id | 844844 |
| size | 18,945 |
macros-rs is a simple, lightweight, and useful library for miscellaneous macros.
To get started check out the docs on docs.rs!
// main.rs
use macros_rs::{exp::ternary, fmt::fmtstr};
fn main() {
let value = true;
let hello = "hello";
println!("{:?} world", ternary!(value, fmtstr!("{hello}"), ""));
}
$ cargo run
Compiling project (/crates)
Finished build [unoptimized + debuginfo] target(s)
"hello" world