Skip to content

Optional Vec Parameters #26

@gembin

Description

@gembin
#[derive(Debug, AttrArgs)]
struct MyArgs {
    foo: Option<String>,
    bar: Option<Vec<String>>,
}

Error

15 | #[derive(AttrArgs)]
   |          ^^^^^^^^ the trait `From<ParamVal>` is not implemented for `Option<Vec<std::string::String>>`
   |
   = help: the following implementations were found:
             <Option<&'a T> as From<&'a Option<T>>>
             <Option<&'a mut T> as From<&'a mut Option<T>>>
             <Option<T> as From<T>>
   = note: required because of the requirements on the impl of `Into<Option<Vec<std::string::String>>>` for `ParamVal`
   = note: required because of the requirements on the impl of `TryFrom<ParamVal>` for `Option<Vec<std::string::String>>`
   = note: required because of the requirements on the impl of `FromParameters` for `Option<Vec<std::string::String>>`
   = note: required by `from_parameters`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions