1#[macro_export] 2macro_rules! s { 3 ($x:expr) => { 4 String::from($x) 5 }; 6} 7 8#[cfg(test)] 9mod tests { 10 use super::*; 11 12 #[test] 13 fn test() { 14 assert_eq!(String::from("foo"), s!("foo")); 15 } 16}