style: Use the ? operator for Option

This commit is contained in:
Matt Brubeck 2017-12-08 16:53:17 -08:00
parent c52d347022
commit 3005a26daf
13 changed files with 47 additions and 129 deletions

View file

@ -169,10 +169,8 @@ impl<E: TElement> StyleBloom<E> {
/// Pop the last element in the bloom filter and return it.
#[inline]
fn pop(&mut self) -> Option<E> {
let (popped_element, num_hashes) = match self.elements.pop() {
None => return None,
Some(x) => (*x.element, x.num_hashes),
};
let PushedElement { element, num_hashes } = self.elements.pop()?;
let popped_element = *element;
// Verify that the pushed hashes match the ones we'd get from the element.
let mut expected_hashes = vec![];