Vec of Path
PolyProgrammist opened this issue · comments
Vadim Volodin commented
Hi, is it possible to use:
#[macro_name(field = [a, b])]
Ted Driggs commented
Certainly would be possible, but by convention that's normally written in macros as #[macro_name(field(a, b))]
- see #[derive(Debug, Clone, ...)]
as an example. That's available as darling::util::PathList
Ted Driggs commented
On further reflection, there are already two supported ways to handle this:
- Use
darling::util::PathList
as described above. - Use
#[darling(with = ...)]
or#[darling(and_then = ...)]
to accept a [syn::Expr
] as the right-hand value and then validate that the expression is an array of paths or idents.
Given the existence of both these options, I am not inclined to add a new FromMeta
impl.