-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Needless continue for match block #4077
Labels
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
Comments
flip1995
added
the
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
label
May 13, 2019
Similarly, any continue, conditional or not, which is the last statement of the loop it is in, is useless and should be omitted. |
lengyijun
added a commit
to lengyijun/rust-clippy
that referenced
this issue
Sep 21, 2023
…ntinue`, recursively Fixes: rust-lang#4077
lengyijun
added a commit
to lengyijun/rust-clippy
that referenced
this issue
Sep 21, 2023
…ntinue`, recursively Fixes: rust-lang#4077
lengyijun
added a commit
to lengyijun/rust-clippy
that referenced
this issue
Sep 21, 2023
…ntinue`, recursively fixes: rust-lang#4077
@rustbot claim |
lengyijun
added a commit
to lengyijun/rust-clippy
that referenced
this issue
Sep 22, 2023
…ntinue`, recursively fixes: rust-lang#4077
lengyijun
added a commit
to lengyijun/rust-clippy
that referenced
this issue
Sep 22, 2023
…ntinue`, recursively fixes: rust-lang#4077
lengyijun
added a commit
to lengyijun/rust-clippy
that referenced
this issue
Sep 23, 2023
…ntinue`, recursively fixes: rust-lang#4077
lengyijun
added a commit
to lengyijun/rust-clippy
that referenced
this issue
Sep 24, 2023
…ntinue`, recursively fixes: rust-lang#4077
lengyijun
added a commit
to lengyijun/rust-clippy
that referenced
this issue
Sep 25, 2023
…ntinue`, recursively fixes: rust-lang#4077
lengyijun
added a commit
to lengyijun/rust-clippy
that referenced
this issue
Sep 25, 2023
…ntinue`, recursively fixes: rust-lang#4077
lengyijun
added a commit
to lengyijun/rust-clippy
that referenced
this issue
Sep 26, 2023
…ntinue`, recursively fixes: rust-lang#4077
lengyijun
added a commit
to lengyijun/rust-clippy
that referenced
this issue
Sep 26, 2023
…ntinue`, recursively fixes: rust-lang#4077
profetia
pushed a commit
to profetia/rust-clippy
that referenced
this issue
Dec 28, 2024
…ntinue`, recursively fixes: rust-lang#4077
profetia
pushed a commit
to profetia/rust-clippy
that referenced
this issue
Dec 28, 2024
…ntinue`, recursively fixes: rust-lang#4077
@rustbot claim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tl;dr Fix simple needless continue
Currently,
needless_continue
only checks possible removal ofcontinue
by reorderingif-else
block. One more simpler needless continue to be removed:From https://github.com/Gymmasssorla/finshir/blob/eae5d0c6761f5558c8ed33ef098d8bd13a07e64f/src/testing/mod.rs#L124-L136
Which
continue
can be dropped.One more in https://github.com/Gymmasssorla/finshir/blob/eae5d0c6761f5558c8ed33ef098d8bd13a07e64f/src/testing/mod.rs#L150-L164
What needs to be achieve here is to check if there are any
continue
at the end of each branches (includingif-else
andmatch
blocks).Possible code changes to clippy can probably be done in https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/needless_continue.rs#L374
The text was updated successfully, but these errors were encountered: