From 418842faf9135da4b70b12fd8b88bc6b8d504cfc Mon Sep 17 00:00:00 2001 From: faineance Date: Sun, 27 Mar 2016 11:50:08 +0100 Subject: use self.0 instead of destructing single item tuple structs --- components/script/script_thread.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'components/script/script_thread.rs') 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); 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 { - let SendableMainThreadScriptChan(ref chan) = *self; + let ref chan = self.0; box SendableMainThreadScriptChan((*chan).clone()) } } @@ -345,12 +344,11 @@ pub struct MainThreadScriptChan(pub Sender); 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 { - let MainThreadScriptChan(ref chan) = *self; + let ref chan = self.0; box MainThreadScriptChan((*chan).clone()) } } -- cgit v1.2.3 From 7c45a4fea031ac97400c6b8416a7b4b897bd0f52 Mon Sep 17 00:00:00 2001 From: faineance Date: Sun, 27 Mar 2016 13:29:06 +0100 Subject: change changes effecting verbosity --- components/script/script_thread.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'components/script/script_thread.rs') diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index de3d6b5cae2..5876f7d16c9 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -325,8 +325,7 @@ impl ScriptChan for SendableMainThreadScriptChan { } fn clone(&self) -> Box { - let ref chan = self.0; - box SendableMainThreadScriptChan((*chan).clone()) + box SendableMainThreadScriptChan((&self.0).clone()) } } @@ -348,8 +347,7 @@ impl ScriptChan for MainThreadScriptChan { } fn clone(&self) -> Box { - let ref chan = self.0; - box MainThreadScriptChan((*chan).clone()) + box MainThreadScriptChan((&self.0).clone()) } } -- cgit v1.2.3