Skip to content

Commit

Permalink
update to rust HEAD, switch to rustc_serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
erickt committed Jan 5, 2015
1 parent f1929ca commit b98719a
Show file tree
Hide file tree
Showing 16 changed files with 219 additions and 182 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ license = "MIT/Apache-2.0"
name = "serde"
path = "src/lib.rs"

[dependencies]
rustc-serialize = "*"

[dependencies.serde_macros]
path = "serde_macros/"
18 changes: 10 additions & 8 deletions benches/bench_enum.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
#![feature(phase)]
#![feature(associated_types, phase, old_orphan_check)]

#[phase(plugin)]
extern crate serde_macros;

extern crate serde;
extern crate serialize;
extern crate "rustc-serialize" as rustc_serialize;
extern crate test;

use test::Bencher;

use serialize::{Decoder, Decodable};
use rustc_serialize::{Decoder, Decodable};

use serde::de::{Deserializer, Deserialize};

use Animal::{Dog, Frog};

//////////////////////////////////////////////////////////////////////////////

#[deriving(Clone, PartialEq, Show, Decodable)]
#[deriving_deserialize]
#[derive(Clone, PartialEq, Show, RustcDecodable)]
#[derive_deserialize]
enum Animal {
Dog,
Frog(String, int)
}

//////////////////////////////////////////////////////////////////////////////

#[deriving(Show)]
#[derive(Show)]
pub enum Error {
EndOfStream,
SyntaxError,
Expand All @@ -36,7 +36,7 @@ pub enum Error {
//////////////////////////////////////////////////////////////////////////////

mod decoder {
use serialize::Decoder;
use rustc_serialize::Decoder;

use super::{Animal, Error};
use super::Animal::{Dog, Frog};
Expand Down Expand Up @@ -265,7 +265,9 @@ mod deserializer {
}
}

impl Iterator<Result<de::Token, Error>> for AnimalDeserializer {
impl Iterator for AnimalDeserializer {
type Item = Result<de::Token, Error>;

#[inline]
fn next(&mut self) -> Option<Result<de::Token, Error>> {
match self.stack.pop() {
Expand Down
Loading

0 comments on commit b98719a

Please sign in to comment.