about summary refs log tree commit diff
path: root/src/librustc_interface
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2019-12-06 12:18:32 +0000
committervarkor <github@varkor.com>2019-12-06 12:24:54 +0000
commit9f1269f23c5f0c1c6a53118b51cf52415ac0bb1c (patch)
treea7b18394302ae6733495354966b81188380a5ea8 /src/librustc_interface
parent8579fe6fc3a28e5a7cbd95ada3a3305a73782c82 (diff)
downloadrust-9f1269f23c5f0c1c6a53118b51cf52415ac0bb1c.tar.gz
rust-9f1269f23c5f0c1c6a53118b51cf52415ac0bb1c.zip
Rename to `then_some` and `then`
Diffstat (limited to 'src/librustc_interface')
-rw-r--r--src/librustc_interface/passes.rs2
-rw-r--r--src/librustc_interface/queries.rs2
-rw-r--r--src/librustc_interface/util.rs4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs
index 753d7b02cca..2a4bc41f850 100644
--- a/src/librustc_interface/passes.rs
+++ b/src/librustc_interface/passes.rs
@@ -547,7 +547,7 @@ fn output_contains_path(output_paths: &[PathBuf], input_path: &PathBuf) -> bool
 }
 
 fn output_conflicts_with_dir(output_paths: &[PathBuf]) -> Option<PathBuf> {
-    let check = |output_path: &PathBuf| output_path.is_dir().to_option_with(|| output_path.clone());
+    let check = |output_path: &PathBuf| output_path.is_dir().then(|| output_path.clone());
     check_output(output_paths, check)
 }
 
diff --git a/src/librustc_interface/queries.rs b/src/librustc_interface/queries.rs
index 7413899fac6..061d3854a9a 100644
--- a/src/librustc_interface/queries.rs
+++ b/src/librustc_interface/queries.rs
@@ -117,7 +117,7 @@ impl<'tcx> Queries<'tcx> {
 
     pub fn dep_graph_future(&self) -> Result<&Query<Option<DepGraphFuture>>> {
         self.dep_graph_future.compute(|| {
-            Ok(self.session().opts.build_dep_graph().to_option_with(|| {
+            Ok(self.session().opts.build_dep_graph().then(|| {
                 rustc_incremental::load_dep_graph(self.session())
             }))
         })
diff --git a/src/librustc_interface/util.rs b/src/librustc_interface/util.rs
index 3d227f91ed6..8c225b83f40 100644
--- a/src/librustc_interface/util.rs
+++ b/src/librustc_interface/util.rs
@@ -107,7 +107,7 @@ const STACK_SIZE: usize = 16 * 1024 * 1024;
 fn get_stack_size() -> Option<usize> {
     // FIXME: Hacks on hacks. If the env is trying to override the stack size
     // then *don't* set it explicitly.
-    env::var_os("RUST_MIN_STACK").is_none().to_option(STACK_SIZE)
+    env::var_os("RUST_MIN_STACK").is_none().then_some(STACK_SIZE)
 }
 
 struct Sink(Arc<Mutex<Vec<u8>>>);
@@ -281,7 +281,7 @@ fn get_rustc_path_inner(bin_path: &str) -> Option<PathBuf> {
             } else {
                 "rustc"
             });
-            candidate.exists().to_option(candidate)
+            candidate.exists().then_some(candidate)
         })
         .next()
 }