prefix-stmts

Crates.ioprefix-stmts
lib.rsprefix-stmts
version1.0.0
created_at2025-12-12 20:57:39.312336+00
updated_at2025-12-12 20:57:39.312336+00
descriptionMacro to prefix several statements with the given tokens.
homepage
repositoryhttps://www.github.com/aseminaunz/prefix-stmts
max_upload_size
id1982117
size12,764
Aimar Seminario (Aseminaunz)

documentation

README

Prefix Stmts

docs.rs crates.io license

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);
		}
	}
}
Commit count: 0

cargo fmt