prefix-stmts 1.0.0

Macro to prefix several statements with the given tokens.
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented2 out of 2 items with examples
  • Size
  • Source code size: 12.25 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.21 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Aseminaunz

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);
		}
	}
}