-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsL-unused_parensLint: unused_parensLint: unused_parensT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=5b455db4401f5a5f2bd6bec013fab8de
use clap::{Parser};
#[derive(Debug, Parser)]
pub struct Args {
#[arg(short, long, value_name="ingredients.txt", default_value_t=("ingredients.rs".to_owned()))]
ingredients: String,
}
The current output is:
warning: unnecessary parentheses around assigned value
--> src/lib.rs:5:70
|
5 | #[arg(short, long, value_name="ingredients.txt", default_value_t=("ingredients.rs".to_owned()))]
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
5 - #[arg(short, long, value_name="ingredients.txt", default_value_t=("ingredients.rs".to_owned()))]
5 + #[arg(short, long, value_name="ingredients.txt", default_value_t="ingredients.rs".to_owned())]
|
However removing the parenthesis results in
error: expected `,`
--> src/lib.rs:5:86
|
5 | #[arg(short, long, value_name="ingredients.txt", default_value_t="ingredients.rs".to_owned())]
| ^
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsL-unused_parensLint: unused_parensLint: unused_parensT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.