From b2f40b9873ac828610c3f97bc7408316b1c9c86f Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 10 Jan 2015 16:39:00 +0100 Subject: Make Runnable::handler take self by value. With my thanks to kimundi and eddyb for their help in making this approach work. --- components/script/script_task.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'components/script/script_task.rs') diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 4783d8539f4..46488446b9d 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -96,7 +96,7 @@ pub enum TimerSource { } pub trait Runnable { - fn handler(&self); + fn handler(self: Box); } /// Messages used to control script event loops, such as ScriptTask and @@ -1385,7 +1385,7 @@ impl DocumentProgressHandler { } impl Runnable for DocumentProgressHandler { - fn handler(&self) { + fn handler(self: Box) { match self.task { DocumentProgressTask::DOMContentLoaded => { self.dispatch_dom_content_loaded(); -- cgit v1.2.3