-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
value_parser that should return Vec<u8> panics with Mismatch between definition and access of Payload
. Could not downcast to u8, need to downcast to alloc::vec::Vec<u8>
#4481
Comments
clap determines what to do based on the wrapping type, in this case To work around this, you can fully qualify the type, like |
I am having this issue as well. I get the following rust panic:
I have the following code snippet from my derived struct:
This previously worked when |
Here's some extra debug output running in the project instead of the binary:
|
btw I lost track of this being the issue for improving customizing the type, so we now have #4626 which has more information in that direction, so closing in favor of that issue. @fritzrehde as your case is more of a support issue (helping debug), could you start a discussion and, at minimum, include the signature for |
Please complete the following tasks
Rust Version
rustc 1.64.0 (a55dd71d5 2022-09-19)
Clap Version
clap = { version = "4.0.23", features = ["derive"] }
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo run -- 0x11
cargo.Toml should also contain hex = "0.4.3" dependency
Actual Behaviour
Main thread panics with
thread 'main' panicked at 'Mismatch between definition and access of
Payload. Could not downcast to u8, need to downcast to alloc::vec::Vec<u8>
Expected Behaviour
The result of
parse_hex_values
should be assigned to payload field.Additional Context
No response
Debug Output
The text was updated successfully, but these errors were encountered: