mirror of
https://github.com/servo/servo.git
synced 2025-06-13 19:04:30 +00:00
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:
parent
14ff55443f
commit
b2f40b9873
3 changed files with 8 additions and 6 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue