1#[macro_export] 2macro_rules! string { 3 ($lit:literal) => { 4 String::from($lit) 5 }; 6} 7 8mod tests { 9 #[test] 10 fn test_string() { 11 assert_eq!(string!("hello"), "hello".to_owned()); 12 } 13}