We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cda54d commit 308c930Copy full SHA for 308c930
clippy_lints/src/needless_deref.rs
@@ -50,16 +50,16 @@ impl LateLintPass<'_> for NeedlessDeref {
50
51
let map = cx.tcx.hir();
52
if let Some(parent_hir_id) = map.find_parent_node(e.hir_id){
53
- let span=map.span(parent_hir_id);
+ let span = map.span(parent_hir_id);
54
if span.from_expansion() {
55
return;
56
}
57
let parent_node = map.find(parent_hir_id);
58
if let Some(rustc_hir::Node::Expr(parent_expr)) = parent_node {
59
- if matches!(parent_expr.kind, ExprKind::Unary(UnOp::Deref, ..)) ||
60
- matches!(parent_expr.kind, ExprKind::AddrOf(..) ){
61
- return;
62
- }
+ if matches!(parent_expr.kind, ExprKind::Unary(UnOp::Deref, ..)) ||
+ matches!(parent_expr.kind, ExprKind::AddrOf(..) ) {
+ return;
+ }
63
64
65
0 commit comments