diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-02-12 23:56:38 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-02-12 23:56:38 +0100 |
commit | a7154e1305d354a7745b23bf4583a9af1ab635dd (patch) | |
tree | 68d26655f07b289748a0f18e78aabad02faa5ab7 /components/script/page.rs | |
parent | 79914e560f1ce4b1510fe4fa7971ec2109e9251e (diff) | |
download | servo-a7154e1305d354a7745b23bf4583a9af1ab635dd.tar.gz servo-a7154e1305d354a7745b23bf4583a9af1ab635dd.zip |
Use if-let in join_layout.
Diffstat (limited to 'components/script/page.rs')
-rw-r--r-- | components/script/page.rs | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/components/script/page.rs b/components/script/page.rs index 2d85f9db9b5..b369a5e3337 100644 --- a/components/script/page.rs +++ b/components/script/page.rs @@ -327,23 +327,19 @@ 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) => { - match join_port.try_recv() { - Err(Empty) => { - info!("script: waiting on layout"); - join_port.recv().unwrap(); - } - Ok(_) => {} - Err(Disconnected) => { - panic!("Layout task failed while script was waiting for a result."); - } + if let Some(join_port) = replace(&mut *layout_join_port, None) { + match join_port.try_recv() { + Err(Empty) => { + info!("script: waiting on layout"); + join_port.recv().unwrap(); + } + Ok(_) => {} + Err(Disconnected) => { + panic!("Layout task failed while script was waiting for a result."); } - - debug!("script: layout joined") } - None => (), + + debug!("script: layout joined") } } |