aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorfaineance <faineance@users.noreply.github.com>2016-03-27 11:50:08 +0100
committerfaineance <faineance@users.noreply.github.com>2016-03-27 11:50:08 +0100
commit418842faf9135da4b70b12fd8b88bc6b8d504cfc (patch)
tree64690189fcf218696759273c2c29cc2799db8e25 /components/script/script_thread.rs
parent68a8085a2f11d052948145980a0bf8a46471e3a7 (diff)
downloadservo-418842faf9135da4b70b12fd8b88bc6b8d504cfc.tar.gz
servo-418842faf9135da4b70b12fd8b88bc6b8d504cfc.zip
use self.0 instead of destructing single item tuple structs
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 9cfc2627786..de3d6b5cae2 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -321,12 +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;
+ let ref chan = self.0;
box SendableMainThreadScriptChan((*chan).clone())
}
}
@@ -345,12 +344,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;
+ let ref chan = self.0;
box MainThreadScriptChan((*chan).clone())
}
}