mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Use Result::ok in CompositorReceiver
This commit is contained in:
parent
d16ba51b47
commit
d366384184
1 changed files with 1 additions and 4 deletions
|
@ -48,10 +48,7 @@ pub trait CompositorReceiver : 'static {
|
||||||
/// A convenience implementation of `CompositorReceiver` for a plain old Rust `Receiver`.
|
/// A convenience implementation of `CompositorReceiver` for a plain old Rust `Receiver`.
|
||||||
impl CompositorReceiver for Receiver<Msg> {
|
impl CompositorReceiver for Receiver<Msg> {
|
||||||
fn try_recv_compositor_msg(&mut self) -> Option<Msg> {
|
fn try_recv_compositor_msg(&mut self) -> Option<Msg> {
|
||||||
match self.try_recv() {
|
self.try_recv().ok()
|
||||||
Ok(msg) => Some(msg),
|
|
||||||
Err(_) => None,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fn recv_compositor_msg(&mut self) -> Msg {
|
fn recv_compositor_msg(&mut self) -> Msg {
|
||||||
self.recv().unwrap()
|
self.recv().unwrap()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue