Skip to content

Commit 626d1af

Browse files
committed
Auto merge of #114250 - matthiaskrgr:rollup-0r0dhrr, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #110056 (Fix the example in document for WaitTimeoutResult::timed_out) - #112655 (Mark `map_or` as `#[must_use]`) - #114018 (Make `--error-format human-annotate-rs` handle multiple files) - #114068 (inline format!() args up to and including rustc_middle (2)) - #114223 (Documentation: Fix Stilted Language in Vec->Indexing) - #114227 (Add tidy check for stray rustfix files) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 6663c54 + 8081b2d commit 626d1af

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

clippy_lints/src/operators/bit_mask.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ fn check_compare(cx: &LateContext<'_>, bit_op: &Expr<'_>, cmp_op: BinOpKind, cmp
4040
if op.node != BinOpKind::BitAnd && op.node != BinOpKind::BitOr {
4141
return;
4242
}
43-
fetch_int_literal(cx, right)
44-
.or_else(|| fetch_int_literal(cx, left))
45-
.map_or((), |mask| check_bit_mask(cx, op.node, cmp_op, mask, cmp_value, span));
43+
if let Some(mask) = fetch_int_literal(cx, right).or_else(|| fetch_int_literal(cx, left)) {
44+
check_bit_mask(cx, op.node, cmp_op, mask, cmp_value, span);
45+
}
4646
}
4747
}
4848

tests/ui/result_map_or_into_option.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ fn main() {
1515
// A non-Some `f` closure where the argument is not used as the
1616
// return should not emit the lint
1717
let opt: Result<u32, &str> = Ok(1);
18-
opt.map_or(None, |_x| Some(1));
18+
_ = opt.map_or(None, |_x| Some(1));
1919
}

tests/ui/result_map_or_into_option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ fn main() {
1515
// A non-Some `f` closure where the argument is not used as the
1616
// return should not emit the lint
1717
let opt: Result<u32, &str> = Ok(1);
18-
opt.map_or(None, |_x| Some(1));
18+
_ = opt.map_or(None, |_x| Some(1));
1919
}

0 commit comments

Comments
 (0)