mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use try syntax for Option where appropriate
This commit is contained in:
parent
fe16c1d5c3
commit
2d45e9d2da
19 changed files with 65 additions and 180 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue