-
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
feat: add new lint seek_from_current
#9681
feat: add new lint seek_from_current
#9681
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @giraffate (or someone else) soon. Please see the contribution instructions for more information. |
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.
This needs to implement msrv
because stream_position
was implemented at 1.51.0: https://doc.rust-lang.org/stable/std/io/trait.Seek.html#method.stream_position
This comment is helpful for implementing msrv
: #9667 (review)
clippy_lints/src/methods/mod.rs
Outdated
/// Ok(()) | ||
/// } | ||
/// ``` | ||
#[clippy::version = "1.65.0"] |
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.
#[clippy::version = "1.65.0"] | |
#[clippy::version = "1.66.0"] |
@giraffate Thank you for review, fixed in 42a0c72 |
☔ The latest upstream changes (presumably #9541) made this pull request unmergeable. Please resolve the merge conflicts. |
42a0c72
to
84d08f4
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.
clippy_lints/src/lib.register_complexity.rs
and src/docs.rs
seem to include the unrelated changes, so can these be addressed?
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.
Can the test for msrv
be added?
ref: https://github.com/rust-lang/rust-clippy/pull/8692/files#diff-451ecfe3eb1cef4b5a0b556b3c1f66eea9fc2fa0c48ceb40110efc0d45d58215
34e6bd5
to
b2e0526
Compare
@giraffate fixed! |
☔ The latest upstream changes (presumably #9667) made this pull request unmergeable. Please resolve the merge conflicts. |
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'll merge this once the conflicts are resolved.
addresses rust-lang#7886 added `seek_from_current` complexity lint. it checks use of `Seek#seek` with `SeekFrom::Current(0)` and suggests `Seek#stream_position` method fix: add msrv fix: register LintInfo fix: remove unnecessary files fix: add test for msrv fix: remove fix fix: remove docs
b2e0526
to
6efb3a2
Compare
Thanks! |
@bors r+ Thanks! |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
changelog:
seek_from_current
: new lint to suggest usingstream_position
instead of seek from current position withSeekFrom::Current(0)
addresses #7886.
This PR is related to #9667, so I will update
methods/mod.rs
if it get conflicted.