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/task_source/networking.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'components/script/task_source/networking.rs') diff --git a/components/script/task_source/networking.rs b/components/script/task_source/networking.rs index 8ebeecdb965..29a5997475e 100644 --- a/components/script/task_source/networking.rs +++ b/components/script/task_source/networking.rs @@ -10,12 +10,11 @@ pub struct NetworkingTaskSource(pub Sender); impl ScriptChan for NetworkingTaskSource { fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> { - let NetworkingTaskSource(ref chan) = *self; - chan.send(MainThreadScriptMsg::Common(msg)).map_err(|_| ()) + self.0.send(MainThreadScriptMsg::Common(msg)).map_err(|_| ()) } fn clone(&self) -> Box { - let NetworkingTaskSource(ref chan) = *self; + let ref chan = self.0; box NetworkingTaskSource((*chan).clone()) } } -- cgit v1.2.3