Skip to content

Aseminaunz/prefix-stmts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Rust macro to prefix several statements with the given tokens.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages