about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJarredAllen <jarredallen73@gmail.com>2020-08-12 13:24:55 -0700
committerJarredAllen <jarredallen73@gmail.com>2020-08-12 13:24:55 -0700
commit4e28d99f413572087a74e1a70b17f051a08d3821 (patch)
treefabe7d8a6f288b3b05148f19870ccd11355871fa
parent480ccc3dbec4440bea0aa1f47d2ad21ebcdd578e (diff)
downloadrust-4e28d99f413572087a74e1a70b17f051a08d3821.tar.gz
rust-4e28d99f413572087a74e1a70b17f051a08d3821.zip
Replace panics with early returns
-rw-r--r--clippy_lints/src/types.rs6
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,