Use try syntax for Option where appropriate

This commit is contained in:
Matt Brubeck 2017-10-20 08:25:35 -07:00
parent fe16c1d5c3
commit 2d45e9d2da
19 changed files with 65 additions and 180 deletions

View file

@ -219,12 +219,7 @@ impl HTMLCanvasElement {
let msg = CanvasMsg::FromScript(FromScriptMsg::SendPixels(sender));
context.get_ipc_renderer().send(msg).unwrap();
match receiver.recv().unwrap() {
Some(pixels) => pixels,
None => {
return None;
}
}
receiver.recv().unwrap()?
},
Some(&CanvasContext::WebGL(_)) => {
// TODO: add a method in WebGLRenderingContext to get the pixels.