-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Merged by Bors] - fix new clippy lints #5160
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
Conversation
it would be better to wait for the new lint to be fixed rather than add an ignore for an unstable lint |
examples/app/custom_loop.rs
Outdated
|
||
struct Input(String); | ||
|
||
fn my_runner(mut app: App) { | ||
println!("Type stuff into the console"); | ||
for line in io::stdin().lock().lines() { | ||
#[allow(clippy::significant_drop_in_scrutinee)] // https://github.com/rust-lang/rust-clippy/issues/8963 |
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'd prefer to avoid ignoring this for as long as we can.
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 removed the ignore.
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.
The PR still contains the change
- use std::io::BufRead;
- for line in io::stdin().lock().lines() {
+ for line in io::stdin().lines() {
which was stabilized in 1.62 and has an equivalent implementation https://doc.rust-lang.org/stable/std/io/struct.Stdin.html#method.lines.
I can revert the change if it shouldn't be in this clippy fix PR.
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'm fine with this change being included.
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.
In agreement with Francois above. But the rest of the changes look good to me.
bors r+ |
# Objective - Nightly clippy lints should be fixed before they get stable and break CI ## Solution - fix new clippy lints - ignore `significant_drop_in_scrutinee` since it isn't relevant in our loop rust-lang/rust-clippy#8987 ```rust for line in io::stdin().lines() { ... } ``` Co-authored-by: Jakob Hellermann <hellermann@sipgate.de>
# Objective - Nightly clippy lints should be fixed before they get stable and break CI ## Solution - fix new clippy lints - ignore `significant_drop_in_scrutinee` since it isn't relevant in our loop rust-lang/rust-clippy#8987 ```rust for line in io::stdin().lines() { ... } ``` Co-authored-by: Jakob Hellermann <hellermann@sipgate.de>
# Objective - Nightly clippy lints should be fixed before they get stable and break CI ## Solution - fix new clippy lints - ignore `significant_drop_in_scrutinee` since it isn't relevant in our loop rust-lang/rust-clippy#8987 ```rust for line in io::stdin().lines() { ... } ``` Co-authored-by: Jakob Hellermann <hellermann@sipgate.de>
# Objective - Nightly clippy lints should be fixed before they get stable and break CI ## Solution - fix new clippy lints - ignore `significant_drop_in_scrutinee` since it isn't relevant in our loop rust-lang/rust-clippy#8987 ```rust for line in io::stdin().lines() { ... } ``` Co-authored-by: Jakob Hellermann <hellermann@sipgate.de>
Objective
Solution
significant_drop_in_scrutinee
since it isn't relevant in our loop significant_drop_in_scrutinee is confusing and not very useful for for loops rust-lang/rust-clippy#8987