Merge pull request #12 from renato-zannon/update-to-nightly
Update to nightly
This commit is contained in:
commit
45247c7ef6
@ -150,12 +150,13 @@ mod decoder {
|
||||
_f: |&mut AnimalDecoder| -> Result<T, Error>)
|
||||
-> Result<T, Error> { Err(SyntaxError) }
|
||||
|
||||
fn read_tuple<T>(&mut self, _f: |&mut AnimalDecoder, uint| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError) }
|
||||
fn read_tuple<T>(&mut self, _len: uint, _f: |&mut AnimalDecoder| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError) }
|
||||
fn read_tuple_arg<T>(&mut self, _a_idx: uint, _f: |&mut AnimalDecoder| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError) }
|
||||
|
||||
fn read_tuple_struct<T>(&mut self,
|
||||
_s_name: &str,
|
||||
_f: |&mut AnimalDecoder, uint| -> Result<T, Error>)
|
||||
_len: uint,
|
||||
_f: |&mut AnimalDecoder| -> Result<T, Error>)
|
||||
-> Result<T, Error> { Err(SyntaxError) }
|
||||
fn read_tuple_struct_arg<T>(&mut self,
|
||||
_a_idx: uint,
|
||||
|
@ -569,10 +569,10 @@ fn push_all_bytes(dst: &mut Vec<u8>, src: &[u8]) {
|
||||
let dst_len = dst.len();
|
||||
let src_len = src.len();
|
||||
|
||||
dst.reserve_additional(src_len);
|
||||
dst.reserve(src_len);
|
||||
|
||||
unsafe {
|
||||
// we would have failed if `reserve_additional` overflowed.
|
||||
// we would have failed if `reserve` overflowed.
|
||||
dst.set_len(dst_len + src_len);
|
||||
|
||||
::std::ptr::copy_nonoverlapping_memory(
|
||||
|
@ -28,7 +28,7 @@ pub enum Error {
|
||||
|
||||
mod decoder {
|
||||
use std::collections::HashMap;
|
||||
use std::collections::hashmap::MoveEntries;
|
||||
use std::collections::hash_map::MoveEntries;
|
||||
use serialize;
|
||||
|
||||
use super::{Error, EndOfStream, SyntaxError, OtherError};
|
||||
@ -122,12 +122,13 @@ mod decoder {
|
||||
_f: |&mut IntDecoder| -> Result<T, Error>)
|
||||
-> Result<T, Error> { Err(SyntaxError) }
|
||||
|
||||
fn read_tuple<T>(&mut self, _f: |&mut IntDecoder, uint| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError) }
|
||||
fn read_tuple<T>(&mut self, _len: uint, _f: |&mut IntDecoder| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError) }
|
||||
fn read_tuple_arg<T>(&mut self, _a_idx: uint, _f: |&mut IntDecoder| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError) }
|
||||
|
||||
fn read_tuple_struct<T>(&mut self,
|
||||
_s_name: &str,
|
||||
_f: |&mut IntDecoder, uint| -> Result<T, Error>)
|
||||
_len: uint,
|
||||
_f: |&mut IntDecoder| -> Result<T, Error>)
|
||||
-> Result<T, Error> { Err(SyntaxError) }
|
||||
fn read_tuple_struct_arg<T>(&mut self,
|
||||
_a_idx: uint,
|
||||
@ -169,7 +170,7 @@ mod decoder {
|
||||
|
||||
mod deserializer {
|
||||
use std::collections::HashMap;
|
||||
use std::collections::hashmap::MoveEntries;
|
||||
use std::collections::hash_map::MoveEntries;
|
||||
|
||||
use super::{Error, EndOfStream, SyntaxError};
|
||||
|
||||
|
@ -191,12 +191,13 @@ mod decoder {
|
||||
}
|
||||
}
|
||||
|
||||
fn read_tuple<T>(&mut self, _f: |&mut OuterDecoder, uint| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError("".to_string())) }
|
||||
fn read_tuple<T>(&mut self, _len: uint, _f: |&mut OuterDecoder| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError("".to_string())) }
|
||||
fn read_tuple_arg<T>(&mut self, _a_idx: uint, _f: |&mut OuterDecoder| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError("".to_string())) }
|
||||
|
||||
fn read_tuple_struct<T>(&mut self,
|
||||
_s_name: &str,
|
||||
_f: |&mut OuterDecoder, uint| -> Result<T, Error>)
|
||||
_len: uint,
|
||||
_f: |&mut OuterDecoder| -> Result<T, Error>)
|
||||
-> Result<T, Error> { Err(SyntaxError("".to_string())) }
|
||||
fn read_tuple_struct_arg<T>(&mut self,
|
||||
_a_idx: uint,
|
||||
|
@ -105,12 +105,13 @@ mod decoder {
|
||||
_f: |&mut IntDecoder| -> Result<T, Error>)
|
||||
-> Result<T, Error> { Err(SyntaxError) }
|
||||
|
||||
fn read_tuple<T>(&mut self, _f: |&mut IntDecoder, uint| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError) }
|
||||
fn read_tuple<T>(&mut self, _len: uint, _f: |&mut IntDecoder| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError) }
|
||||
fn read_tuple_arg<T>(&mut self, _a_idx: uint, _f: |&mut IntDecoder| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError) }
|
||||
|
||||
fn read_tuple_struct<T>(&mut self,
|
||||
_s_name: &str,
|
||||
_f: |&mut IntDecoder, uint| -> Result<T, Error>)
|
||||
_len: uint,
|
||||
_f: |&mut IntDecoder| -> Result<T, Error>)
|
||||
-> Result<T, Error> { Err(SyntaxError) }
|
||||
fn read_tuple_struct_arg<T>(&mut self,
|
||||
_a_idx: uint,
|
||||
@ -211,12 +212,13 @@ mod decoder {
|
||||
_f: |&mut U8Decoder| -> Result<T, Error>)
|
||||
-> Result<T, Error> { Err(SyntaxError) }
|
||||
|
||||
fn read_tuple<T>(&mut self, _f: |&mut U8Decoder, uint| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError) }
|
||||
fn read_tuple<T>(&mut self, _len: uint, _f: |&mut U8Decoder| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError) }
|
||||
fn read_tuple_arg<T>(&mut self, _a_idx: uint, _f: |&mut U8Decoder| -> Result<T, Error>) -> Result<T, Error> { Err(SyntaxError) }
|
||||
|
||||
fn read_tuple_struct<T>(&mut self,
|
||||
_s_name: &str,
|
||||
_f: |&mut U8Decoder, uint| -> Result<T, Error>)
|
||||
_len: uint,
|
||||
_f: |&mut U8Decoder| -> Result<T, Error>)
|
||||
-> Result<T, Error> { Err(SyntaxError) }
|
||||
fn read_tuple_struct_arg<T>(&mut self,
|
||||
_a_idx: uint,
|
||||
|
14
src/de.rs
14
src/de.rs
@ -364,10 +364,10 @@ pub trait Deserializer<E>: Iterator<Result<Token, E>> {
|
||||
Ok(None)
|
||||
}
|
||||
Str(n) => {
|
||||
Ok(Some(fields.iter().position(|field| **field == n)))
|
||||
Ok(Some(fields.iter().position(|field| *field == n)))
|
||||
}
|
||||
String(n) => {
|
||||
Ok(Some(fields.iter().position(|field| **field == n.as_slice())))
|
||||
Ok(Some(fields.iter().position(|field| *field == n.as_slice())))
|
||||
}
|
||||
token => {
|
||||
Err(self.syntax_error(token, STR_TOKEN_KINDS))
|
||||
@ -882,27 +882,27 @@ impl GatherTokens {
|
||||
self.gather(d)
|
||||
}
|
||||
EnumStart(name, variant, len) => {
|
||||
self.tokens.reserve_additional(len + 1);
|
||||
self.tokens.reserve(len + 1);
|
||||
self.tokens.push(EnumStart(name, variant, len));
|
||||
self.gather_seq(d)
|
||||
}
|
||||
StructStart(name, len) => {
|
||||
self.tokens.reserve_additional(len + 1);
|
||||
self.tokens.reserve(len + 1);
|
||||
self.tokens.push(StructStart(name, len));
|
||||
self.gather_struct(d)
|
||||
}
|
||||
TupleStart(len) => {
|
||||
self.tokens.reserve_additional(len + 1);
|
||||
self.tokens.reserve(len + 1);
|
||||
self.tokens.push(TupleStart(len));
|
||||
self.gather_seq(d)
|
||||
}
|
||||
SeqStart(len) => {
|
||||
self.tokens.reserve_additional(len + 1);
|
||||
self.tokens.reserve(len + 1);
|
||||
self.tokens.push(SeqStart(len));
|
||||
self.gather_seq(d)
|
||||
}
|
||||
MapStart(len) => {
|
||||
self.tokens.reserve_additional(len + 1);
|
||||
self.tokens.reserve(len + 1);
|
||||
self.tokens.push(MapStart(len));
|
||||
self.gather_map(d)
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ fn main() {
|
||||
*/
|
||||
|
||||
use std::char;
|
||||
use std::collections::{HashMap, TreeMap, treemap};
|
||||
use std::collections::{HashMap, TreeMap, tree_map};
|
||||
use std::f32;
|
||||
use std::f64;
|
||||
use std::fmt;
|
||||
@ -324,7 +324,7 @@ impl Json {
|
||||
/// Otherwise, returns None.
|
||||
pub fn find<'a>(&'a self, key: &string::String) -> Option<&'a Json>{
|
||||
match self {
|
||||
&Object(ref map) => map.find(key),
|
||||
&Object(ref map) => map.get(key),
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
@ -349,7 +349,7 @@ impl Json {
|
||||
pub fn search<'a>(&'a self, key: &string::String) -> Option<&'a Json> {
|
||||
match self {
|
||||
&Object(ref map) => {
|
||||
match map.find(key) {
|
||||
match map.get(key) {
|
||||
Some(json_value) => Some(json_value),
|
||||
None => {
|
||||
let mut value : Option<&'a Json> = None;
|
||||
@ -573,7 +573,7 @@ impl<D: de::Deserializer<E>, E> de::Deserializable<D, E> for Json {
|
||||
enum JsonDeserializerState {
|
||||
JsonDeserializerValueState(Json),
|
||||
JsonDeserializerListState(vec::MoveItems<Json>),
|
||||
JsonDeserializerObjectState(treemap::MoveEntries<string::String, Json>),
|
||||
JsonDeserializerObjectState(tree_map::MoveEntries<string::String, Json>),
|
||||
JsonDeserializerEndState,
|
||||
}
|
||||
|
||||
@ -2237,7 +2237,7 @@ impl<Iter: Iterator<u8>> de::Deserializer<ParserError> for Parser<Iter> {
|
||||
None => { return Ok(None); }
|
||||
};
|
||||
|
||||
Ok(Some(fields.iter().position(|field| **field == s.as_slice())))
|
||||
Ok(Some(fields.iter().position(|field| *field == s.as_slice())))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user