Skip to content

Commit 4e28d99

Browse files
committed
Replace panics with early returns
1 parent 480ccc3 commit 4e28d99

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,13 @@ impl Types {
357357
let box_ty = match &last_path_segment(qpath).args.unwrap().args[0] {
358358
GenericArg::Type(ty) => match &ty.kind {
359359
TyKind::Path(qpath) => qpath,
360-
_ => panic!("Box that isn't a type"),
360+
_ => return,
361361
},
362-
_ => panic!("Rc without type argument"),
362+
_ => return,
363363
};
364364
let inner_span = match &last_path_segment(&box_ty).args.unwrap().args[0] {
365365
GenericArg::Type(ty) => ty.span,
366-
_ => panic!("Box without type argument"),
366+
_ => return,
367367
};
368368
span_lint_and_sugg(
369369
cx,

0 commit comments

Comments
 (0)