Open SteveLauC opened 4 months ago
If I'm understanding correctly, you are saying that Foo::from_str
can fail. In that case, we need to be able to render a message but we don't know how to render a message for ()
. It seems like an error is the correct thing to do.
In that case, we need to be able to render a message but we don't know how to render a message for (). It seems like an error is the correct thing to do.
This is understandable. I am wondering can we:
Either will make the case better
We can't improve the error message.
As for documenting it, the challenge is finding the right places where someone is expected to look and won't add to a wall of text that will make it so no one will read any of it.
Please complete the following tasks
Rust Version
rustc 1.76.0 (07dca489a 2024-02-04)
Clap Version
4.5.1
Minimal reproducible code
Steps to reproduce the bug with the above code
With the above code, run
cargo build
Actual Behaviour
Expected Behaviour
Build without issues
Additional Context
Related issues:
4286
From this issue, I found you can fix it by
impl From<String> for Foo
.4994
From this one, I found that you can also fix it by changing the
()
type to other types as described in this comment:Debug Output