style: Use a more compact form for should_process_descendants.

This commit is contained in:
Emilio Cobos Álvarez 2018-01-12 10:32:50 +01:00
parent 5b7d9eb94a
commit a69d229615
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 7 additions and 10 deletions

View file

@ -81,11 +81,10 @@ impl<'a, E: TElement> InvalidationProcessor<'a, E> for DocumentStateInvalidation
}
fn should_process_descendants(&mut self, element: E) -> bool {
let data = match element.borrow_data() {
Some(d) => d,
None => return false,
};
state_and_attributes::should_process_descendants(&data)
match element.borrow_data() {
Some(d) => state_and_attributes::should_process_descendants(&d),
None => false,
}
}
fn invalidated_descendants(&mut self, element: E, child: E) {

View file

@ -298,12 +298,10 @@ where
return should_process_descendants(&self.data)
}
let data = match element.borrow_data() {
Some(d) => d,
match element.borrow_data() {
Some(d) => should_process_descendants(&d),
None => return false,
};
should_process_descendants(&data)
}
}
fn recursion_limit_exceeded(&mut self, element: E) {