Skip to content

Commit e01a8df

Browse files
committed
Eliminate else in type_certainty
1 parent 3f96362 commit e01a8df

File tree

1 file changed

+5
-5
lines changed
  • clippy_utils/src/ty/type_certainty

1 file changed

+5
-5
lines changed

clippy_utils/src/ty/type_certainty/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ fn type_certainty(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> Certainty {
135135
// certainty using `Certainty::meet`. Thus, if the `TyKind::Path` were not treated specially here,
136136
// the resulting certainty would be `Certainty::Certain(None)`.
137137
if let TyKind::Path(qpath) = &ty.kind {
138-
qpath_certainty(cx, qpath, true)
139-
} else {
140-
let mut visitor = CertaintyVisitor::new(cx);
141-
visitor.visit_ty(ty);
142-
visitor.certainty
138+
return qpath_certainty(cx, qpath, true);
143139
}
140+
141+
let mut visitor = CertaintyVisitor::new(cx);
142+
visitor.visit_ty(ty);
143+
visitor.certainty
144144
}
145145

146146
fn generic_args_certainty(cx: &LateContext<'_>, args: &GenericArgs<'_>) -> Certainty {

0 commit comments

Comments
 (0)