mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Upgrade to rustc ba2f13ef0 2015-02-04
This commit is contained in:
parent
bc6882bdef
commit
d5dd1d658e
136 changed files with 1091 additions and 878 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
use serialize::{json, Encodable};
|
||||
use serialize::json::Json;
|
||||
use std::io::{IoError, OtherIoError, EndOfFile, TcpStream, IoResult};
|
||||
use std::old_io::{IoError, OtherIoError, EndOfFile, TcpStream, IoResult};
|
||||
use std::num;
|
||||
|
||||
pub trait JsonPacketStream {
|
||||
|
@ -18,7 +18,7 @@ pub trait JsonPacketStream {
|
|||
|
||||
impl JsonPacketStream for TcpStream {
|
||||
fn write_json_packet<'a, T: Encodable>(&mut self, obj: &T) {
|
||||
let s = json::encode(obj).replace("__type__", "type");
|
||||
let s = json::encode(obj).unwrap().replace("__type__", "type");
|
||||
println!("<- {}", s);
|
||||
self.write_str(s.len().to_string().as_slice()).unwrap();
|
||||
self.write_u8(':' as u8).unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue