about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLzu Tao <taolzu@gmail.com>2019-11-26 14:14:28 +0000
committerLzu Tao <taolzu@gmail.com>2019-11-28 10:52:20 +0700
commitd0e0ffa99f45ef07855c41ec0be30ca5496d8ba3 (patch)
tree45e6005afb6a27f9f2af1df05731f355b8d2fdb6 /src
parent7b8e8293d08d298579470f9d6c74731043c6601a (diff)
downloadrust-d0e0ffa99f45ef07855c41ec0be30ca5496d8ba3.tar.gz
rust-d0e0ffa99f45ef07855c41ec0be30ca5496d8ba3.zip
make use of Result::map_or
Diffstat (limited to 'src')
-rw-r--r--src/driver.rs3
-rw-r--r--src/lintlist/mod.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/driver.rs b/src/driver.rs
index 2a4448cc0ec..2579fb4ad4d 100644
--- a/src/driver.rs
+++ b/src/driver.rs
@@ -1,4 +1,5 @@
 #![cfg_attr(feature = "deny-warnings", deny(warnings))]
+#![feature(result_map_or)]
 #![feature(rustc_private)]
 
 // FIXME: switch to something more ergonomic here, once available.
@@ -319,7 +320,7 @@ pub fn main() {
             // this check ensures that dependencies are built but not linted and the final
             // crate is
             // linted but not built
-            let clippy_enabled = env::var("CLIPPY_TESTS").ok().map_or(false, |val| val == "true")
+            let clippy_enabled = env::var("CLIPPY_TESTS").map_or(false, |val| val == "true")
                 || arg_value(&orig_args, "--emit", |val| val.split(',').any(|e| e == "metadata")).is_some();
 
             if clippy_enabled {
diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs
index 9b258ffb610..715d505abf3 100644
--- a/src/lintlist/mod.rs
+++ b/src/lintlist/mod.rs
@@ -1697,7 +1697,7 @@ pub const ALL_LINTS: [Lint; 337] = [
     Lint {
         name: "result_map_unwrap_or_else",
         group: "pedantic",
-        desc: "using `Result.map(f).unwrap_or_else(g)`, which is more succinctly expressed as `.ok().map_or_else(g, f)`",
+        desc: "using `Result.map(f).unwrap_or_else(g)`, which is more succinctly expressed as `.map_or_else(g, f)`",
         deprecation: None,
         module: "methods",
     },