Skip to content

Commit 429435c

Browse files
committed
Use as_ref().map() rather than is_some().to_option()
1 parent fd38ff6 commit 429435c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/librustc/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ impl<'tcx> Body<'tcx> {
305305
pub fn vars_iter<'a>(&'a self) -> impl Iterator<Item = Local> + 'a {
306306
(self.arg_count + 1..self.local_decls.len()).filter_map(move |index| {
307307
let local = Local::new(index);
308-
self.local_decls[local].is_user_variable.is_some().to_option(local)
308+
self.local_decls[local].is_user_variable.as_ref().map(|_| local)
309309
})
310310
}
311311

src/librustc/session/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ impl Session {
825825
}
826826

827827
pub fn incr_comp_session_dir_opt(&self) -> Option<cell::Ref<'_, PathBuf>> {
828-
self.opts.incremental.is_some().to_option_with(|| self.incr_comp_session_dir())
828+
self.opts.incremental.as_ref().map(|_| self.incr_comp_session_dir())
829829
}
830830

831831
pub fn print_perf_stats(&self) {

0 commit comments

Comments
 (0)