Skip to content

Commit 93438fd

Browse files
committed
make use of Result::map_or
1 parent 8cae411 commit 93438fd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/librustc_mir/transform/const_prop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
505505
let left_bits = place_layout.size.bits();
506506
let right_size = r.layout.size;
507507
let r_bits = r.to_scalar().and_then(|r| r.to_bits(right_size));
508-
if r_bits.ok().map_or(false, |b| b >= left_bits as u128) {
508+
if r_bits.map_or(false, |b| b >= left_bits as u128) {
509509
let lint_root = match &self.source_scopes[source_info.scope].local_data {
510510
ClearCrossCrate::Set(data) => data.lint_root,
511511
ClearCrossCrate::Clear => return None,

src/librustc_typeck/check/method/probe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
14601460
pcx.method_name = Some(method_name);
14611461
pcx.assemble_inherent_candidates();
14621462
pcx.assemble_extension_candidates_for_traits_in_scope(hir::DUMMY_HIR_ID)
1463-
.ok().map_or(None, |_| {
1463+
.map_or(None, |_| {
14641464
pcx.pick_core()
14651465
.and_then(|pick| pick.ok())
14661466
.and_then(|pick| Some(pick.item))

src/libterm/terminfo/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl TermInfo {
7474
Err(..) => return Err(Error::TermUnset),
7575
};
7676

77-
if term.is_err() && env::var("MSYSCON").ok().map_or(false, |s| "mintty.exe" == s) {
77+
if term.is_err() && env::var("MSYSCON").map_or(false, |s| "mintty.exe" == s) {
7878
// msys terminal
7979
Ok(msys_terminfo())
8080
} else {

0 commit comments

Comments
 (0)