aboutsummaryrefslogtreecommitdiffstats
path: root/components/devtools
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-01-01 21:49:19 +0100
committerMs2ger <ms2ger@gmail.com>2015-01-02 19:04:18 +0100
commitb51e83819dfc2fded3a10744b353338f75ccae4d (patch)
tree1edb2c5d81a53ef4e8d5717a2440599d7a3e0f53 /components/devtools
parent141b5d038fad3c0c44a6f1b309b8ca9edea54580 (diff)
downloadservo-b51e83819dfc2fded3a10744b353338f75ccae4d.tar.gz
servo-b51e83819dfc2fded3a10744b353338f75ccae4d.zip
Fix obsolete format traits.
They are to be removed from the language in the next rust upgrade.
Diffstat (limited to 'components/devtools')
-rw-r--r--components/devtools/actor.rs12
-rw-r--r--components/devtools/actors/console.rs2
-rw-r--r--components/devtools/protocol.rs4
3 files changed, 9 insertions, 9 deletions
diff --git a/components/devtools/actor.rs b/components/devtools/actor.rs
index 54b59bc8d79..178b840ebce 100644
--- a/components/devtools/actor.rs
+++ b/components/devtools/actor.rs
@@ -85,7 +85,7 @@ impl ActorRegistry {
}
pub fn register_script_actor(&self, script_id: String, actor: String) {
- println!("registering {:s} ({:s})", actor.as_slice(), script_id.as_slice());
+ println!("registering {} ({})", actor.as_slice(), script_id.as_slice());
let mut script_actors = self.script_actors.borrow_mut();
script_actors.insert(script_id, actor);
}
@@ -103,19 +103,19 @@ impl ActorRegistry {
pub fn actor_to_script(&self, actor: String) -> String {
for (key, value) in self.script_actors.borrow().iter() {
- println!("checking {:s}", value.as_slice());
+ println!("checking {}", value.as_slice());
if value.as_slice() == actor.as_slice() {
return key.to_string();
}
}
- panic!("couldn't find actor named {:s}", actor)
+ panic!("couldn't find actor named {}", actor)
}
/// Create a unique name based on a monotonically increasing suffix
pub fn new_name(&self, prefix: &str) -> String {
let suffix = self.next.get();
self.next.set(suffix + 1);
- format!("{:s}{:u}", prefix, suffix)
+ format!("{}{}", prefix, suffix)
}
/// Add an actor to the registry of known actors that can receive messages.
@@ -154,11 +154,11 @@ impl ActorRegistry {
-> Result<(), ()> {
let to = msg.get(&"to".to_string()).unwrap().as_string().unwrap();
match self.actors.get(&to.to_string()) {
- None => println!("message received for unknown actor \"{:s}\"", to),
+ None => println!("message received for unknown actor \"{}\"", to),
Some(actor) => {
let msg_type = msg.get(&"type".to_string()).unwrap().as_string().unwrap();
if !try!(actor.handle_message(self, &msg_type.to_string(), msg, stream)) {
- println!("unexpected message type \"{:s}\" found for actor \"{:s}\"",
+ println!("unexpected message type \"{}\" found for actor \"{}\"",
msg_type, to);
}
}
diff --git a/components/devtools/actors/console.rs b/components/devtools/actors/console.rs
index 3e0c934bddb..8839e6f8a34 100644
--- a/components/devtools/actors/console.rs
+++ b/components/devtools/actors/console.rs
@@ -163,7 +163,7 @@ impl Actor for ConsoleActor {
messages.push(json::from_str(json::encode(&message).as_slice()).unwrap().as_object().unwrap().clone());*/
}
- s => println!("unrecognized message type requested: \"{:s}\"", s),
+ s => println!("unrecognized message type requested: \"{}\"", s),
}
}
diff --git a/components/devtools/protocol.rs b/components/devtools/protocol.rs
index 52cfdaa3536..e657741b9e3 100644
--- a/components/devtools/protocol.rs
+++ b/components/devtools/protocol.rs
@@ -16,7 +16,7 @@ pub trait JsonPacketStream {
impl JsonPacketStream for TcpStream {
fn write_json_packet<'a, T: Encodable<json::Encoder<'a>,IoError>>(&mut self, obj: &T) {
let s = json::encode(obj).replace("__type__", "type");
- println!("<- {:s}", s);
+ println!("<- {}", s);
self.write_str(s.len().to_string().as_slice()).unwrap();
self.write_u8(':' as u8).unwrap();
self.write_str(s.as_slice()).unwrap();
@@ -35,7 +35,7 @@ impl JsonPacketStream for TcpStream {
let packet_len = num::from_str_radix(packet_len_str.as_slice(), 10).unwrap();
let packet_buf = self.read_exact(packet_len).unwrap();
let packet = String::from_utf8(packet_buf).unwrap();
- println!("{:s}", packet);
+ println!("{}", packet);
return Ok(json::from_str(packet.as_slice()).unwrap())
},
Err(ref e) if e.kind == EndOfFile =>