diff options
| author | bors <bors@rust-lang.org> | 2022-03-21 20:42:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-03-21 20:42:51 +0000 |
| commit | f07ee8a998eff61977d594eeac44dc1d0ead7b02 (patch) | |
| tree | d17e9b7df751c8b47538dc9a610863954fde5d73 /clippy_lints/src/write.rs | |
| parent | 4a07662d948bd831eba6a87b7acc080cbee88d4a (diff) | |
| parent | 773d20341ad8061df9acca781bab7a0fb38ed684 (diff) | |
| download | rust-f07ee8a998eff61977d594eeac44dc1d0ead7b02.tar.gz rust-f07ee8a998eff61977d594eeac44dc1d0ead7b02.zip | |
Auto merge of #8232 - Jarcho:match_same_arm_860, r=xFrednet
`match_same_arms` fix fixes #860 fixes #1140 changelog: Don't lint `match_same_arms` when an interposing arm's pattern would overlap
Diffstat (limited to 'clippy_lints/src/write.rs')
| -rw-r--r-- | clippy_lints/src/write.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clippy_lints/src/write.rs b/clippy_lints/src/write.rs index 532bd810a2e..f3d818cc348 100644 --- a/clippy_lints/src/write.rs +++ b/clippy_lints/src/write.rs @@ -581,14 +581,19 @@ impl Write { }; let replacement: String = match lit.token.kind { - LitKind::Integer | LitKind::Float | LitKind::Err => continue, LitKind::StrRaw(_) | LitKind::ByteStrRaw(_) if matches!(fmtstr.style, StrStyle::Raw(_)) => { lit.token.symbol.as_str().replace('{', "{{").replace('}', "}}") }, LitKind::Str | LitKind::ByteStr if matches!(fmtstr.style, StrStyle::Cooked) => { lit.token.symbol.as_str().replace('{', "{{").replace('}', "}}") }, - LitKind::StrRaw(_) | LitKind::Str | LitKind::ByteStrRaw(_) | LitKind::ByteStr => continue, + LitKind::StrRaw(_) + | LitKind::Str + | LitKind::ByteStrRaw(_) + | LitKind::ByteStr + | LitKind::Integer + | LitKind::Float + | LitKind::Err => continue, LitKind::Byte | LitKind::Char => match lit.token.symbol.as_str() { "\"" if matches!(fmtstr.style, StrStyle::Cooked) => "\\\"", "\"" if matches!(fmtstr.style, StrStyle::Raw(0)) => continue, |
