Skip to content

Commit 7943c9c

Browse files
committed
Use Option::map_or instead of open coding it
1 parent 9475e60 commit 7943c9c

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)