Simplify using early return and Result::ok()

This commit is contained in:
Greg Fitzgerald
2018-09-07 09:56:51 -06:00
parent d8564b725c
commit 7f99c90539

View File

@ -60,13 +60,13 @@ fn find_next_missing(
recycler.recycle(blob, "find_next_missing");
}
}
if slot.data.is_none() {
if slot.data.is_some() {
return None;
}
let val = crdt.read().unwrap().window_index_request(pix as u64);
if let Ok((to, req)) = val {
return Some((to, req));
}
}
None
val.ok()
})
.collect()
}