Skip to content

Commit 2153d1e

Browse files
committed
manual fixups if_let_chain -> if_chain
1 parent 41840ae commit 2153d1e

File tree

4 files changed

+96
-92
lines changed

4 files changed

+96
-92
lines changed

clippy_lints/src/assign_ops.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
140140
let parent_fn = cx.tcx.hir.get_parent(e.id);
141141
let parent_impl = cx.tcx.hir.get_parent(parent_fn);
142142
// the crate node is the only one that is not in the map
143-
if_let_chain!{[
144-
parent_impl != ast::CRATE_NODE_ID,
145-
let hir::map::Node::NodeItem(item) = cx.tcx.hir.get(parent_impl),
146-
let hir::Item_::ItemImpl(_, _, _, _, Some(ref trait_ref), _, _) = item.node,
147-
trait_ref.path.def.def_id() == trait_id
148-
], { return; }}
143+
if_chain! {
144+
if parent_impl != ast::CRATE_NODE_ID;
145+
if let hir::map::Node::NodeItem(item) = cx.tcx.hir.get(parent_impl);
146+
if let hir::Item_::ItemImpl(_, _, _, _, Some(ref trait_ref), _, _) = item.node;
147+
if trait_ref.path.def.def_id() == trait_id;
148+
then { return; }
149+
}
149150
implements_trait($cx, $ty, trait_id, &[$rty])
150151
},)*
151152
_ => false,

clippy_lints/src/new_without_default.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
142142
span,
143143
"try this",
144144
&format!(
145-
"impl Default for {} {{
146-
fn default() -> Self {{
147-
Self::new()
148-
}}
149-
}}",
145+
"impl Default for {} {{
146+
fn default() -> Self {{
147+
Self::new()
148+
}}
149+
}}",
150150
self_ty));
151151
});
152152
}

0 commit comments

Comments
 (0)