Rollup merge of - rust-lang:oli-obk-patch-1, r=jackh726

Simplify use of `map_or`
This commit is contained in:
Matthias Krüger 2022-01-22 15:32:51 +01:00 committed by GitHub
commit 2ecbc4b49d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -418,7 +418,7 @@ impl BasicCoverageBlockData {
pub fn take_edge_counters( pub fn take_edge_counters(
&mut self, &mut self,
) -> Option<impl Iterator<Item = (BasicCoverageBlock, CoverageKind)>> { ) -> Option<impl Iterator<Item = (BasicCoverageBlock, CoverageKind)>> {
self.edge_from_bcbs.take().map_or(None, |m| Some(m.into_iter())) self.edge_from_bcbs.take().map(|m| m.into_iter())
} }
pub fn id(&self) -> String { pub fn id(&self) -> String {