Skip to content

Commit

Permalink
Move if condiction from then block out.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongmao86 committed Jan 23, 2021
1 parent 2d1203d commit cb1c415
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions clippy_lints/src/into_instead_of_from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@ impl LateLintPass<'tcx> for IntoInsteadOfFrom {
if_chain! {
if let Some(tr_ref) = wbp.bounds[0].trait_ref();
if let Some(def_id) = tr_ref.trait_def_id();
if cx.tcx.is_diagnostic_item(sym::from_trait, def_id);
then {
if cx.tcx.is_diagnostic_item(sym::from_trait, def_id) {
span_lint(
cx,
INTO_INSTEAD_OF_FROM,
wp.span(),
"What is WHERE PREDICATE"
);
}
span_lint(
cx,
INTO_INSTEAD_OF_FROM,
wp.span(),
"What is WHERE PREDICATE"
);
}
}
},
Expand Down

0 comments on commit cb1c415

Please sign in to comment.