diff options
| author | JarredAllen <jarredallen73@gmail.com> | 2020-08-12 13:24:55 -0700 |
|---|---|---|
| committer | JarredAllen <jarredallen73@gmail.com> | 2020-08-12 13:24:55 -0700 |
| commit | 4e28d99f413572087a74e1a70b17f051a08d3821 (patch) | |
| tree | fabe7d8a6f288b3b05148f19870ccd11355871fa | |
| parent | 480ccc3dbec4440bea0aa1f47d2ad21ebcdd578e (diff) | |
| download | rust-4e28d99f413572087a74e1a70b17f051a08d3821.tar.gz rust-4e28d99f413572087a74e1a70b17f051a08d3821.zip | |
Replace panics with early returns
| -rw-r--r-- | clippy_lints/src/types.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index 78cebc30472..e0204273197 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -357,13 +357,13 @@ impl Types { let box_ty = match &last_path_segment(qpath).args.unwrap().args[0] { GenericArg::Type(ty) => match &ty.kind { TyKind::Path(qpath) => qpath, - _ => panic!("Box that isn't a type"), + _ => return, }, - _ => panic!("Rc without type argument"), + _ => return, }; let inner_span = match &last_path_segment(&box_ty).args.unwrap().args[0] { GenericArg::Type(ty) => ty.span, - _ => panic!("Box without type argument"), + _ => return, }; span_lint_and_sugg( cx, |
