about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJane Lusby <jlusby@yaah.dev>2020-08-26 16:31:49 -0700
committerJane Lusby <jlusby@yaah.dev>2020-08-26 16:31:49 -0700
commit91024f1fdee2d2c2febfc7c76127d68d2b6e629e (patch)
treeb4fc470d1761d4c0bed9023a0642eaf7981dda98 /src
parente45c59e922c4450b8ab136eac38a37000fca9254 (diff)
downloadrust-91024f1fdee2d2c2febfc7c76127d68d2b6e629e.tar.gz
rust-91024f1fdee2d2c2febfc7c76127d68d2b6e629e.zip
Add new lint to prevent usage of unwrap in fns that return result
Diffstat (limited to 'src')
-rw-r--r--src/lintlist/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs
index eadd2621a40..687fac7baa8 100644
--- a/src/lintlist/mod.rs
+++ b/src/lintlist/mod.rs
@@ -2517,6 +2517,13 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
         module: "unused_unit",
     },
     Lint {
+        name: "unwrap_in_result",
+        group: "restriction",
+        desc: "functions of type `Result<..>` or `Option`<...> that contain `expect()` or `unwrap()`",
+        deprecation: None,
+        module: "unwrap_in_result",
+    },
+    Lint {
         name: "unwrap_used",
         group: "restriction",
         desc: "using `.unwrap()` on `Result` or `Option`, which should at least get a better message using `expect()`",