Auto merge of #8161 - A-deLuna:fix-#8154, r=jdm

Fixes #8154 Convert match to `if let` in handle_window_event 



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8161)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-10-23 05:35:33 -06:00
commit 51ab0abb7f

View file

@ -171,8 +171,7 @@ impl Window {
(_, VirtualKeyCode::LWin) => self.toggle_modifier(LEFT_SUPER),
(_, VirtualKeyCode::RWin) => self.toggle_modifier(RIGHT_SUPER),
(_, key_code) => {
match Window::glutin_key_to_script_key(key_code) {
Ok(key) => {
if let Ok(key) = Window::glutin_key_to_script_key(key_code) {
let state = match element_state {
ElementState::Pressed => KeyState::Pressed,
ElementState::Released => KeyState::Released,
@ -180,8 +179,6 @@ impl Window {
let modifiers = Window::glutin_mods_to_script_mods(self.key_modifiers.get());
self.event_queue.borrow_mut().push(WindowEvent::KeyEvent(key, state, modifiers));
}
_ => {}
}
}
}
}