summaryrefslogtreecommitdiff
path: root/utils/src/macros.rs
blob: f1cb75e4abbb7006e623d4beda0b8be45de1053f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// A macro for creating a `Vec<String>` from string literals.
///
/// # Examples
/// ```
/// # use cli_utils::string_vec;
/// 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()),*]
    };
}