Skip to content

Commit

Permalink
Clippy: HACK! Fix bootstrap error
Browse files Browse the repository at this point in the history
This will be removed in the next sync, once beta is at 1.52. Until then
this hack avoids to put `cfg(bootstrap)` into Clippy.
  • Loading branch information
flip1995 committed Mar 12, 2021
1 parent 412ebc3 commit 99d0519
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tools/clippy/clippy_lints/src/loops/manual_memcpy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,11 @@ struct MinifyingSugg<'a>(Sugg<'a>);

impl<'a> MinifyingSugg<'a> {
fn as_str(&self) -> &str {
let (Sugg::NonParen(s) | Sugg::MaybeParen(s) | Sugg::BinOp(_, s)) = &self.0;
s.as_ref()
// HACK: Don't sync to Clippy! Required because something with the `or_patterns` feature
// changed and this would now require parentheses.
match &self.0 {
Sugg::NonParen(s) | Sugg::MaybeParen(s) | Sugg::BinOp(_, s) => s.as_ref(),
}
}

fn into_sugg(self) -> Sugg<'a> {
Expand Down

0 comments on commit 99d0519

Please sign in to comment.