aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-03-28 04:12:31 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-03-28 04:12:31 +0530
commitb97ffffb48080a0b4769f8609a27a68145042945 (patch)
tree6a8c50176786ef2fd387292d00aa49b588e187a2 /components/script/script_thread.rs
parent0826a5b45455cdbecf484136b1bab39bcc0b15ff (diff)
parent7c45a4fea031ac97400c6b8416a7b4b897bd0f52 (diff)
downloadservo-b97ffffb48080a0b4769f8609a27a68145042945.tar.gz
servo-b97ffffb48080a0b4769f8609a27a68145042945.zip
Auto merge of #10222 - faineance:master, r=KiChjang
Use self.0 instead of destructuring single item tuple structs. Closes #9698. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10222) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs12
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())
}
}