diff options
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 9cfc2627786..5876f7d16c9 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -321,13 +321,11 @@ pub struct SendableMainThreadScriptChan(pub Sender<CommonScriptMsg>); impl ScriptChan for SendableMainThreadScriptChan { fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> { - let SendableMainThreadScriptChan(ref chan) = *self; - chan.send(msg).map_err(|_| ()) + self.0.send(msg).map_err(|_| ()) } fn clone(&self) -> Box<ScriptChan + Send> { - let SendableMainThreadScriptChan(ref chan) = *self; - box SendableMainThreadScriptChan((*chan).clone()) + box SendableMainThreadScriptChan((&self.0).clone()) } } @@ -345,13 +343,11 @@ pub struct MainThreadScriptChan(pub Sender<MainThreadScriptMsg>); impl ScriptChan for MainThreadScriptChan { fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> { - let MainThreadScriptChan(ref chan) = *self; - chan.send(MainThreadScriptMsg::Common(msg)).map_err(|_| ()) + self.0.send(MainThreadScriptMsg::Common(msg)).map_err(|_| ()) } fn clone(&self) -> Box<ScriptChan + Send> { - let MainThreadScriptChan(ref chan) = *self; - box MainThreadScriptChan((*chan).clone()) + box MainThreadScriptChan((&self.0).clone()) } } |