aboutsummaryrefslogtreecommitdiffstats
path: root/components/devtools
diff options
context:
space:
mode:
Diffstat (limited to 'components/devtools')
-rw-r--r--components/devtools/actor.rs16
-rw-r--r--components/devtools/lib.rs10
2 files changed, 8 insertions, 18 deletions
diff --git a/components/devtools/actor.rs b/components/devtools/actor.rs
index 634622a2068..73180a784ed 100644
--- a/components/devtools/actor.rs
+++ b/components/devtools/actor.rs
@@ -33,23 +33,23 @@ pub trait Actor: Any + ActorAsAny {
}
pub trait ActorAsAny {
- fn actor_as_any(&self) -> &Any;
- fn actor_as_any_mut(&mut self) -> &mut Any;
+ fn actor_as_any(&self) -> &dyn Any;
+ fn actor_as_any_mut(&mut self) -> &mut dyn Any;
}
impl<T: Actor> ActorAsAny for T {
- fn actor_as_any(&self) -> &Any {
+ fn actor_as_any(&self) -> &dyn Any {
self
}
- fn actor_as_any_mut(&mut self) -> &mut Any {
+ fn actor_as_any_mut(&mut self) -> &mut dyn Any {
self
}
}
/// A list of known, owned actors.
pub struct ActorRegistry {
- actors: HashMap<String, Box<Actor + Send>>,
- new_actors: RefCell<Vec<Box<Actor + Send>>>,
+ actors: HashMap<String, Box<dyn Actor + Send>>,
+ new_actors: RefCell<Vec<Box<dyn Actor + Send>>>,
old_actors: RefCell<Vec<String>>,
script_actors: RefCell<HashMap<String, String>>,
shareable: Option<Arc<Mutex<ActorRegistry>>>,
@@ -131,11 +131,11 @@ impl ActorRegistry {
}
/// Add an actor to the registry of known actors that can receive messages.
- pub fn register(&mut self, actor: Box<Actor + Send>) {
+ pub fn register(&mut self, actor: Box<dyn Actor + Send>) {
self.actors.insert(actor.name(), actor);
}
- pub fn register_later(&self, actor: Box<Actor + Send>) {
+ pub fn register_later(&self, actor: Box<dyn Actor + Send>) {
let mut actors = self.new_actors.borrow_mut();
actors.push(actor);
}
diff --git a/components/devtools/lib.rs b/components/devtools/lib.rs
index be40e70eec6..0768a79ed09 100644
--- a/components/devtools/lib.rs
+++ b/components/devtools/lib.rs
@@ -12,20 +12,10 @@
#![allow(non_snake_case)]
#![deny(unsafe_code)]
-extern crate devtools_traits;
-extern crate headers_core;
-extern crate headers_ext;
-extern crate http;
-extern crate hyper;
-extern crate ipc_channel;
#[macro_use]
extern crate log;
-extern crate msg;
#[macro_use]
extern crate serde;
-extern crate serde_json;
-extern crate servo_channel;
-extern crate time;
use crate::actor::{Actor, ActorRegistry};
use crate::actors::browsing_context::BrowsingContextActor;