Skip to content
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

Add support for binary function calls in suspicious_operation_groupings lint #6474

Open
MarijnS95 opened this issue Dec 19, 2020 · 0 comments
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages E-medium Call for participation: Medium difficulty level problem and requires some initial experience.

Comments

@MarijnS95
Copy link
Contributor

#6086 introduced suspicious_operation_groupings that made us find a binop issue in Gstreamer. In addition to if statements in #6275 it'd be nice to support binary function call chains like cmp as well, which suffered the same issue:

self.0
    .hours
    .cmp(&other.0.hours)
    .then_with(|| self.0.minutes.cmp(&other.0.hours)) // Should be other.0.minutes
    .then_with(|| self.0.seconds.cmp(&other.0.seconds))
    .then_with(|| self.0.frames.cmp(&other.0.frames))

The expressions are separated by then_with and closures instead of a simple && binary op so this might be quite a stretch.

@ebroto ebroto added the C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages label Dec 19, 2020
@camsteffen camsteffen added the E-medium Call for participation: Medium difficulty level problem and requires some initial experience. label Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages E-medium Call for participation: Medium difficulty level problem and requires some initial experience.
Projects
None yet
Development

No branches or pull requests

3 participants