1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/// Wrapper around `Vec<String>` to provide
/// several convenient conversions for the
/// `QueryBuilder`.
pub struct QueryAliases(pub Vec<String>);

impl From<Vec<String>> for QueryAliases {
    fn from(value: Vec<String>) -> Self {
        QueryAliases(value)
    }
}

impl From<Vec<&str>> for QueryAliases {
    fn from(value: Vec<&str>) -> Self {
        QueryAliases(value.iter().map(|v| v.to_string()).collect())
    }
}

impl From<&str> for QueryAliases {
    fn from(value: &str) -> Self {
        QueryAliases(vec![value.to_string()])
    }
}

impl From<String> for QueryAliases {
    fn from(value: String) -> Self {
        QueryAliases(vec![value])
    }
}