Use if-let in join_layout.

This commit is contained in:
Ms2ger 2015-02-12 23:56:38 +01:00
parent 79914e560f
commit a7154e1305

View file

@ -327,9 +327,7 @@ impl Page {
/// layout task has finished any pending request messages.
fn join_layout(&self) {
let mut layout_join_port = self.layout_join_port.borrow_mut();
let join_port = replace(&mut *layout_join_port, None);
match join_port {
Some(ref join_port) => {
if let Some(join_port) = replace(&mut *layout_join_port, None) {
match join_port.try_recv() {
Err(Empty) => {
info!("script: waiting on layout");
@ -343,8 +341,6 @@ impl Page {
debug!("script: layout joined")
}
None => (),
}
}
/// Reflows the page if it's possible to do so and the page is dirty. This method will wait