| Crates.io | prefix-stmts |
| lib.rs | prefix-stmts |
| version | 1.0.0 |
| created_at | 2025-12-12 20:57:39.312336+00 |
| updated_at | 2025-12-12 20:57:39.312336+00 |
| description | Macro to prefix several statements with the given tokens. |
| homepage | |
| repository | https://www.github.com/aseminaunz/prefix-stmts |
| max_upload_size | |
| id | 1982117 |
| size | 12,764 |
A utility macro to prefix each of several statements with the given tokens.
use ::prefix_stmts::prefix_stmts;
prefix_stmts! {
[ #[cfg(feature = "alloc")] ]
extern crate alloc;
use alloc::vec::Vec;
pub fn mutate_vec(v: &mut Vec<u32>) {
prefix_stmts! {
[ println!("Vector is currently: {:#?}", v); ]
v.push(1);
v.push(2);
v.push(3);
}
}
}