script: Use more idiomatic code for resize handling.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2016-12-25 17:20:30 +01:00
parent b319dedda9
commit 755697d6bb
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -725,10 +725,8 @@ impl ScriptThread {
for (id, document) in self.documents.borrow().iter() {
// Only process a resize if layout is idle.
let resize_event = document.window().steal_resize_event();
match resize_event {
Some((size, size_type)) => resizes.push((id, size, size_type)),
None => ()
if let Some((size, size_type)) = document.window().steal_resize_event() {
resizes.push((id, size, size_type));
}
}