Skip to content

Commit 40d74fd

Browse files
committed
Move if condiction from then block out.
1 parent aae5951 commit 40d74fd

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

clippy_lints/src/into_instead_of_from.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,14 @@ impl LateLintPass<'tcx> for IntoInsteadOfFrom {
3737
if_chain! {
3838
if let Some(tr_ref) = wbp.bounds[0].trait_ref();
3939
if let Some(def_id) = tr_ref.trait_def_id();
40+
if cx.tcx.is_diagnostic_item(sym::from_trait, def_id);
4041
then {
41-
if cx.tcx.is_diagnostic_item(sym::from_trait, def_id) {
42-
span_lint(
43-
cx,
44-
INTO_INSTEAD_OF_FROM,
45-
wp.span(),
46-
"What is WHERE PREDICATE"
47-
);
48-
}
42+
span_lint(
43+
cx,
44+
INTO_INSTEAD_OF_FROM,
45+
wp.span(),
46+
"What is WHERE PREDICATE"
47+
);
4948
}
5049
}
5150
},

0 commit comments

Comments
 (0)