aboutsummaryrefslogtreecommitdiffstats
path: root/components/devtools
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-11-01 21:43:04 +0100
committerSimon Sapin <simon.sapin@exyr.org>2018-11-08 09:28:00 +0100
commit2012be4a8bd97f2fd69f986c8fffb1af1eec21dc (patch)
treec9f1ef91146253f72987cb1436866523880965e0 /components/devtools
parentb1fd6237d1304f3d57abdafd3e6e738c1ece9f83 (diff)
downloadservo-2012be4a8bd97f2fd69f986c8fffb1af1eec21dc.tar.gz
servo-2012be4a8bd97f2fd69f986c8fffb1af1eec21dc.zip
`cargo fix --edition-idioms`
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;