macro_rules! svec {
[$($v:tt),*] => { ... };
() => { ... };
}
Expand description
Helper macro to build a Vec<String>
Quite a few ORM methods take Vec<String>
as an argument. Using the built-in
vec![]
macro requires that each element is converted into a String
, which
is very cumbersome.
Using this macro, we can write:
let fields = svec!["string", "literals", "without", "to_string()"];