Skip to content

Commit 6eb0a5f

Browse files
authored
Rollup merge of #89818 - LingMan:map_or, r=oli-obk
Use Option::map_or instead of open coding it ````@rustbot```` modify labels +C-cleanup +T-compiler
2 parents 59ebfdd + 7943c9c commit 6eb0a5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_index/src/bit_set.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ impl<T: Idx> GrowableBitSet<T> {
841841
#[inline]
842842
pub fn contains(&self, elem: T) -> bool {
843843
let (word_index, mask) = word_index_and_mask(elem);
844-
if let Some(word) = self.bit_set.words.get(word_index) { (word & mask) != 0 } else { false }
844+
self.bit_set.words.get(word_index).map_or(false, |word| (word & mask) != 0)
845845
}
846846
}
847847

0 commit comments

Comments
 (0)