blob: 1019d0fb63844b518ab8eda27137c7085a762467 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
/// A macro for creating a `Vec<String>` from string literals.
///
/// # Examples
/// ```
/// let v = string_vec!["hello", "world"];
/// assert_eq!(v, vec!["hello".to_string(), "world".to_string()]);
/// ```
#[macro_export]
macro_rules! string_vec {
($($elem:expr),* $(,)?) => {
vec![$($elem.to_string()),*]
};
}
|