about summary refs log tree commit diff
path: root/clippy_lints/src/needless_continue.rs
AgeCommit message (Collapse)AuthorLines
2025-02-03Simplify `reindent_multiline()` signatureSamuel Tardieu-1/+1
- `reindent_multiline()` always returns the result of `reindent_multiline_inner()` which returns a `String`. Make `reindent_multiline()` return a `String` as well, instead of a systematically owned `Cow<'_, str>`. - There is no reason for `reindent_multiline()` to force a caller to build a `Cow<'_, str>` instead of passing a `&str` directly, especially considering that a `String` will always be returned. Also, both the input parameter and return value (of type `Cow<'_, str>`) shared the same (elided) lifetime for no reason: this worked only because the result was always the `Cow::Owned` variant which is compatible with any lifetime. As a consequence, the signature changes from: ```rust fn reindent_multiline(s: Cow<'_, str>, …) -> Cow<'_, str> { … } ``` to ```rust fn reindent_multiline(s: &str, …) -> String { … } ```
2025-01-02Emit redundant if when duplicated in `needless_continue`yanglsh-8/+21
2024-12-28[`needless_continue`]: lint if the last stmt in for/while/loop is ↵lengyijun-22/+100
`continue`, recursively fixes: #4077
2024-12-26Make "all fields are shorthand" requirement configurableSamuel Moelius-1/+1
Handle field attributes in suggestions Fix adjacent code Address review comments https://github.com/rust-lang/rust-clippy/pull/13737#discussion_r1861352124 Address all review comments but one This comment is not yet addressed: https://github.com/rust-lang/rust-clippy/pull/13737#discussion_r1874544907 `initializer_suggestions` -> `lint_inconsistent_struct_field_initializers`
2024-11-12new lint `unnecessary_map_or`Jacherr-2/+2
2024-11-03needless_continue: check labels consistency before warningSamuel Tardieu-2/+3
2024-08-17Remove redundant doc commentsAlex Macleod-35/+0
2024-05-06Update doc comments to avoid lazy continuationsMichael Howell-2/+1
2024-04-01fix fallout from previous commity21-1/+1
2023-12-19Plumb awaitness of for loopsEric Holk-1/+5
2023-12-01Merge commit 'f0cdee4a3f094416189261481eae374b76792af1' into clippy-subtree-syncPhilipp Krones-1/+1
2023-11-16Merge commit 'edb720b199083f4107b858a8761648065bf38d86' into clippyupPhilipp Krones-15/+13
2023-11-02Merge commit '09ac14c901abc43bd0d617ae4a44e8a4fed98d9c' into clippyupPhilipp Krones-5/+5
2023-10-21Merge commit '2b030eb03d9e5837440b1ee0b98c50b97c0c5889' into clippyupPhilipp Krones-2/+2
2022-11-21Merge commit 'f4850f7292efa33759b4f7f9b7621268979e9914' into clippyupPhilipp Krones-4/+4
2022-10-06Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyupPhilipp Krones-10/+4
2021-12-06Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyupflip1995-0/+1
2021-10-15Fix clippy with changed macro statement spansCameron Steffen-7/+6
2021-08-12Merge commit '7bfc26ec8e7a454786668e7e52ffe527fc649735' into clippyupflip1995-1/+1
2021-07-29Merge commit '0cce3f643bfcbb92d5a1bb71858c9cbaff749d6b' into clippyupflip1995-5/+25
2021-03-25Merge commit '0e87918536b9833bbc6c683d1f9d51ee2bf03ef1' into clippyupflip1995-2/+2
2021-03-12Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyupflip1995-5/+1
2021-01-21Fix clippy and commentEsteban Küber-1/+1
2021-01-21Add loop head span to hirEsteban Küber-1/+1
2020-06-09Merge commit 'ff0993c5e9162ddaea78e83d0f0161e68bd4ea73' into clippyLzu Tao-1/+1
2020-04-18Add an Option<Span> argument to span_lint_and_help.xiongmao86-0/+1
2020-03-01Rustup to rust-lang/rust#69592Yuki Okushi-1/+1
2020-02-06Rename ctx->cx in needless_continueflip1995-20/+20
2020-02-06Improve help message in needless_continueflip1995-12/+14
2020-02-06Rewrite suggestion generation of needless_continueflip1995-79/+84
2020-01-27Rename `span_help_and_lint` to `span_lint_and_help`Yuki Okushi-2/+2
2020-01-13Rustup to rust-lang/rust#68045Yuki Okushi-1/+1
2020-01-11Rustup to rust-lang/rust#67806Yuki Okushi-3/+2
2020-01-07Normalize lint messagesYuki Okushi-4/+4
2020-01-04Rustup to https://github.com/rust-lang/rust/pull/67853Philipp Hansch-1/+1
Specifically caused by https://github.com/rust-lang/rust/pull/67786
2019-12-04Rustup to rust-lang/rust#66878Matthias Krüger-1/+2
2019-10-14new lints around `#[must_use]` fnsAndre Bogus-0/+3
`must_use_unit` lints unit-returning functions with a `#[must_use]` attribute, suggesting to remove it. `double_must_use` lints functions with a plain `#[must_use]` attribute, but which return a type which is already `#[must_use]`, so the attribute has no benefit. `must_use_candidate` is a pedantic lint that lints functions and methods that return some non-unit type that is not already `#[must_use]` and suggests to add the annotation.
2019-09-27Rustup to rust-lang/rust#64813flip1995-6/+6
2019-08-19Remove in_macro_or_desugarKRAAI, MATTHEW [VISUS]-2/+2
2019-08-03Doctests: Enable running doc tests for pedantic lintsPhilipp Hansch-0/+10
2019-06-24Pacify rustfmt.Mazdak Farrokhzad-3/+2
2019-06-23Fix fallout from rust-lang/rust PR 60861.Mazdak Farrokhzad-6/+6
2019-05-11Rename in_macro to in_macro_or_desugarManish Goregaokar-2/+2
2019-04-17Use lint pass macrosMatthew Kraai-13/+2
Fixes #3917.
2019-03-12Auto merge of #3871 - taiki-e:needless_continue, r=phanschbors-14/+26
Fix `needless_continue` false positive If the `continue` has a label, check it matches the label of the loop. Fixes https://github.com/rust-lang/rust-clippy/issues/2329
2019-03-12Run more doc testsPhilipp Hansch-7/+13
This executes some more doc tests that were ignored before.
2019-03-12Fix `needless_continue` false positiveTaiki Endo-14/+26
2019-03-05move lint documentation into macro invocationsAndy Russell-59/+59
2019-01-27rustup https://github.com/rust-lang/rust/pull/57726Matthias Krüger-0/+4
2019-01-08Remove all copyright license headersPhilipp Hansch-9/+0
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498