-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypedValueParser cannot return single Vec<String> #4808
Comments
The problem is we do not know what accessor to use, so we do a hard coded lookup based on the type's name. You can work around this by referring to the type by something other than Closing in favor of #4626 |
I wonder if it might be helpful to document this behavior in the meantime, since it took me a fair while to track down the underlying cause of the issue. |
Huh, I thought we had that somewhere but not seeing it, so added it now. |
There seems to be a typo ("completel"). |
Please complete the following tasks
Rust Version
rustc 1.68.2 (9eb3afe9e 2023-03-27)
Clap Version
4.2.0
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo run
Actual Behaviour
Expected Behaviour
Additional Context
According to the Derive Reference:
This suggests that if I override
action
andrequired
, then myTypedValueParser
can return aVec<T>
just like any otherT
. However, this always produces an error, sinceclap_derive
unconditionally usesget_many
forVec<T>
fields, regardless of what attributes I set. So far, I've been able to work around it by having myTypedValueParser
return aBox<[T]>
, but this is less than ideal.Debug Output
The text was updated successfully, but these errors were encountered: