Make Runnable::handler take self by value.

With my thanks to kimundi and eddyb for their help in making this approach
work.
This commit is contained in:
Ms2ger 2015-01-10 16:39:00 +01:00
parent 14ff55443f
commit b2f40b9873
3 changed files with 8 additions and 6 deletions

View file

@ -96,7 +96,7 @@ pub enum TimerSource {
}
pub trait Runnable {
fn handler(&self);
fn handler(self: Box<Self>);
}
/// 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<DocumentProgressHandler>) {
match self.task {
DocumentProgressTask::DOMContentLoaded => {
self.dispatch_dom_content_loaded();