diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index 05a727d284001..b54043cf70ad0 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -305,7 +305,7 @@ impl<'tcx> Body<'tcx> { pub fn vars_iter<'a>(&'a self) -> impl Iterator + 'a { (self.arg_count + 1..self.local_decls.len()).filter_map(move |index| { let local = Local::new(index); - self.local_decls[local].is_user_variable.is_some().to_option(local) + self.local_decls[local].is_user_variable.as_ref().map(|_| local) }) } diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 285cb8c1c439d..17100cccb0a05 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -825,7 +825,7 @@ impl Session { } pub fn incr_comp_session_dir_opt(&self) -> Option> { - self.opts.incremental.is_some().to_option_with(|| self.incr_comp_session_dir()) + self.opts.incremental.as_ref().map(|_| self.incr_comp_session_dir()) } pub fn print_perf_stats(&self) {