aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task_source
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/task_source')
-rw-r--r--components/script/task_source/dom_manipulation.rs5
-rw-r--r--components/script/task_source/file_reading.rs5
-rw-r--r--components/script/task_source/history_traversal.rs5
-rw-r--r--components/script/task_source/networking.rs5
-rw-r--r--components/script/task_source/user_interaction.rs5
5 files changed, 10 insertions, 15 deletions
diff --git a/components/script/task_source/dom_manipulation.rs b/components/script/task_source/dom_manipulation.rs
index d60ce7de93d..84ec1ca5e78 100644
--- a/components/script/task_source/dom_manipulation.rs
+++ b/components/script/task_source/dom_manipulation.rs
@@ -16,12 +16,11 @@ pub struct DOMManipulationTaskSource(pub Sender<MainThreadScriptMsg>);
impl TaskSource<DOMManipulationTask> for DOMManipulationTaskSource {
fn queue(&self, msg: DOMManipulationTask) -> Result<(), ()> {
- let DOMManipulationTaskSource(ref chan) = *self;
- chan.send(MainThreadScriptMsg::DOMManipulation(msg)).map_err(|_| ())
+ self.0.send(MainThreadScriptMsg::DOMManipulation(msg)).map_err(|_| ())
}
fn clone(&self) -> Box<TaskSource<DOMManipulationTask> + Send> {
- let DOMManipulationTaskSource(ref chan) = *self;
+ let ref chan = self.0;
box DOMManipulationTaskSource((*chan).clone())
}
}
diff --git a/components/script/task_source/file_reading.rs b/components/script/task_source/file_reading.rs
index e4afad34b4b..a9813167e34 100644
--- a/components/script/task_source/file_reading.rs
+++ b/components/script/task_source/file_reading.rs
@@ -10,12 +10,11 @@ pub struct FileReadingTaskSource(pub Sender<MainThreadScriptMsg>);
impl ScriptChan for FileReadingTaskSource {
fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> {
- let FileReadingTaskSource(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 FileReadingTaskSource(ref chan) = *self;
+ let ref chan = self.0;
box FileReadingTaskSource((*chan).clone())
}
}
diff --git a/components/script/task_source/history_traversal.rs b/components/script/task_source/history_traversal.rs
index 0916c121345..d4fb64864a3 100644
--- a/components/script/task_source/history_traversal.rs
+++ b/components/script/task_source/history_traversal.rs
@@ -10,12 +10,11 @@ pub struct HistoryTraversalTaskSource(pub Sender<MainThreadScriptMsg>);
impl ScriptChan for HistoryTraversalTaskSource {
fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> {
- let HistoryTraversalTaskSource(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 HistoryTraversalTaskSource(ref chan) = *self;
+ let ref chan = self.0;
box HistoryTraversalTaskSource((*chan).clone())
}
}
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<MainThreadScriptMsg>);
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<ScriptChan + Send> {
- let NetworkingTaskSource(ref chan) = *self;
+ let ref chan = self.0;
box NetworkingTaskSource((*chan).clone())
}
}
diff --git a/components/script/task_source/user_interaction.rs b/components/script/task_source/user_interaction.rs
index 7912eac720d..a4a2549e63d 100644
--- a/components/script/task_source/user_interaction.rs
+++ b/components/script/task_source/user_interaction.rs
@@ -10,12 +10,11 @@ pub struct UserInteractionTaskSource(pub Sender<MainThreadScriptMsg>);
impl ScriptChan for UserInteractionTaskSource {
fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> {
- let UserInteractionTaskSource(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 UserInteractionTaskSource(ref chan) = *self;
+ let ref chan = self.0;
box UserInteractionTaskSource((*chan).clone())
}
}