Skip to content

Commit

Permalink
Use as_ref().map() rather than is_some().to_option()
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Oct 20, 2019
1 parent fd38ff6 commit 429435c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl<'tcx> Body<'tcx> {
pub fn vars_iter<'a>(&'a self) -> impl Iterator<Item = Local> + '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)
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ impl Session {
}

pub fn incr_comp_session_dir_opt(&self) -> Option<cell::Ref<'_, PathBuf>> {
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) {
Expand Down

0 comments on commit 429435c

Please sign in to comment.