-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
New lint [redundant_at_rest_pattern
]
#11013
Conversation
r? @giraffate (rustbot has picked a reviewer for you, use r? to override) |
20d18c7
to
4fea893
Compare
The first association when I read the title was "REST API" but I don't have any better ideas unfortunately. 😅 |
The book uses the term Maybe |
|
The |
I'm fine with |
redundant_rest_pattern
]redundant_at_rest_pattern
]
1ae3f2f
to
4106124
Compare
4106124
to
e9ced12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, thanks! I made one comment.
/// if let all = v { | ||
/// // NOTE: Type is a `Vec` here | ||
/// println!("all elements: {all:#?}"); | ||
/// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It warns irrefutable_let_patterns
in this case, so can we add the case that simply print?
It would be better to detect irrefutable_let_patterns
, but IMO this lint is still worth it as is.
/// if let all = v { | |
/// // NOTE: Type is a `Vec` here | |
/// println!("all elements: {all:#?}"); | |
/// } | |
/// if let all = v { | |
/// // NOTE: Type is a `Vec` here | |
/// println!("all elements: {all:#?}"); | |
/// } | |
/// // or | |
/// println!("all elements: {v:#?}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine. Many lints clippy or not will still lint even if it'll give a warning, and then that lint will hopefully be applied as well by the programmer. Though yeah I'm fine with adding just the println!
@bors r+ Thanks! |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Closes #11011
It's always a great feeling when a new lint triggers on clippy itself 😄
changelog: New lint [
redundant_at_rest_pattern
]