1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/// This macros provides the fast creating [String](std::string::String) object /// /// # Examples: /// ``` /// use add_macro::str; /// /// let empty_s: String = str!(); /// let s: String = str!("Hello, world!"); /// ``` #[macro_export] macro_rules! str { () => { String::new() }; ($s:expr) => { $s.to_owned() }; }