Skip to content

Commit cb7fe3e

Browse files
committed
Fixup
1 parent 807145d commit cb7fe3e

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ Released 2021-03-25
981981
[#6532](https://github.com/rust-lang/rust-clippy/pull/6532)
982982
* [`single_match`] Suggest `if` over `if let` when possible
983983
[#6574](https://github.com/rust-lang/rust-clippy/pull/6574)
984-
* [`ref_in_deref`] Use parentheses correctly in suggestion
984+
* `ref_in_deref` Use parentheses correctly in suggestion
985985
[#6609](https://github.com/rust-lang/rust-clippy/pull/6609)
986986
* [`stable_sort_primitive`] Clarify error message
987987
[#6611](https://github.com/rust-lang/rust-clippy/pull/6611)

clippy_lints/src/dereference.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,8 @@ impl<'tcx> LateLintPass<'tcx> for Dereferencing {
232232
} else if !adjust.target.is_ref() {
233233
deref_count += 1;
234234
break iter.next();
235-
} else {
236-
deref_count += 1;
237235
}
236+
deref_count += 1;
238237
},
239238
None => break None,
240239
};
@@ -511,10 +510,7 @@ fn is_linted_explicit_deref_position(parent: Option<Node<'_>>, child_id: HirId,
511510
/// Note: This is only correct assuming auto-deref is already occurring.
512511
fn is_auto_reborrow_position(parent: Option<Node<'_>>) -> bool {
513512
match parent {
514-
Some(Node::Expr(parent)) => match parent.kind {
515-
ExprKind::MethodCall(..) | ExprKind::Call(..) => true,
516-
_ => false,
517-
},
513+
Some(Node::Expr(parent)) => matches!(parent.kind, ExprKind::MethodCall(..) | ExprKind::Call(..)),
518514
Some(Node::Local(_)) => true,
519515
_ => false,
520516
}

clippy_lints/src/implicit_hasher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitHasher {
179179
)
180180
.and_then(|snip| {
181181
let i = snip.find("fn")?;
182-
Some(item.span.lo() + BytePos((i + (&snip[i..]).find('(')?) as u32))
182+
Some(item.span.lo() + BytePos((i + snip[i..].find('(')?) as u32))
183183
})
184184
.expect("failed to create span for type parameters");
185185
Span::new(pos, pos, item.span.ctxt(), item.span.parent())

clippy_lints/src/octal_escapes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn check_lit(cx: &EarlyContext<'tcx>, lit: &Lit, span: Span, is_string: bool) {
101101
// construct a replacement escape
102102
// the maximum value is \077, or \x3f, so u8 is sufficient here
103103
if let Ok(n) = u8::from_str_radix(&contents[from + 1..to], 8) {
104-
write!(&mut suggest_1, "\\x{:02x}", n).unwrap();
104+
write!(suggest_1, "\\x{:02x}", n).unwrap();
105105
}
106106

107107
// append the null byte as \x00 and the following digits literally

0 commit comments

Comments
 (0)