1 2 3 4 5 6 7 8 9 10 11 12
pub struct MacroError { pub msg : String, } impl<'a> From<&'a str> for MacroError { fn from(m:&'a str) -> MacroError { MacroError { msg : m.to_owned() } } } impl From<String> for MacroError { fn from(m:String) -> MacroError { MacroError { msg : m } } }