You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't see why this should not just compile. At least there should be a more conclusive error message.
Additional Context
I know I can work around this by using #[arg(long, short, default_value_t = String::from("foo"))] or #[arg(long, short, default_value_t = ("foo".to_string()))].
Though the latter option gives the following warning when compiling:
warning: unnecessary parentheses around assigned value
--> src/main.rs:6:42
|
6 | #[arg(long, short, default_value_t = ("foo".to_string()))]
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
6 - #[arg(long, short, default_value_t = ("foo".to_string()))]
6 + #[arg(long, short, default_value_t = "foo".to_string())]
|
Debug Output
No response
The text was updated successfully, but these errors were encountered:
Please complete the following tasks
Rust Version
rustc 1.71.0 (8ede3aae2 2023-07-12)
Clap Version
4.4.2
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo run
Actual Behaviour
I do get this error:
This message is not really helpful.
Expected Behaviour
I don't see why this should not just compile. At least there should be a more conclusive error message.
Additional Context
I know I can work around this by using
#[arg(long, short, default_value_t = String::from("foo"))]
or#[arg(long, short, default_value_t = ("foo".to_string()))]
.Though the latter option gives the following warning when compiling:
Debug Output
No response
The text was updated successfully, but these errors were encountered: