1/// Get filename without extension of the current source file 2#[macro_export] 3macro_rules! file_stem { 4 () => { 5 ::std::path::Path::new(file!()) 6 .file_stem() 7 .unwrap() 8 .to_str() 9 .unwrap() 10 }; 11} 12 13#[test] 14fn file_stem() { 15 assert!(file_stem!() == "macros"); 16}