Follow rust std: fmt::Show
was renamed to fmt::Debug
This commit is contained in:
parent
5dd077969c
commit
9a284ae7c2
@ -17,7 +17,7 @@ use Animal::{Dog, Frog};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Clone, PartialEq, Show, RustcDecodable)]
|
||||
#[derive(Clone, PartialEq, Debug, RustcDecodable)]
|
||||
#[derive_deserialize]
|
||||
enum Animal {
|
||||
Dog,
|
||||
@ -26,7 +26,7 @@ enum Animal {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Show)]
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
EndOfStream,
|
||||
SyntaxError,
|
||||
|
@ -22,7 +22,7 @@ use serde::ser;
|
||||
|
||||
use rustc_serialize::Encodable;
|
||||
|
||||
#[derive(Show, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
#[derive(Debug, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
#[derive_serialize]
|
||||
#[derive_deserialize]
|
||||
struct Http {
|
||||
@ -37,7 +37,7 @@ struct Http {
|
||||
request_uri: String,
|
||||
}
|
||||
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum HttpProtocol {
|
||||
HTTP_PROTOCOL_UNKNOWN,
|
||||
HTTP10,
|
||||
@ -73,7 +73,7 @@ impl<D: de::Deserializer<E>, E> de::Deserialize<D, E> for HttpProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum HttpMethod {
|
||||
METHOD_UNKNOWN,
|
||||
GET,
|
||||
@ -117,7 +117,7 @@ impl<D: de::Deserializer<E>, E> de::Deserialize<D, E> for HttpMethod {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum CacheStatus {
|
||||
CACHESTATUS_UNKNOWN,
|
||||
Miss,
|
||||
@ -154,7 +154,7 @@ impl<D: de::Deserializer<E>, E> de::Deserialize<D, E> for CacheStatus {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Show, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
#[derive(Debug, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
#[derive_serialize]
|
||||
#[derive_deserialize]
|
||||
struct Origin {
|
||||
@ -164,7 +164,7 @@ struct Origin {
|
||||
protocol: OriginProtocol,
|
||||
}
|
||||
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum OriginProtocol {
|
||||
ORIGIN_PROTOCOL_UNKNOWN,
|
||||
HTTP,
|
||||
@ -200,7 +200,7 @@ impl<D: de::Deserializer<E>, E> de::Deserialize<D, E> for OriginProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum ZonePlan {
|
||||
ZONEPLAN_UNKNOWN,
|
||||
FREE,
|
||||
@ -238,7 +238,7 @@ impl<D: de::Deserializer<E>, E> de::Deserialize<D, E> for ZonePlan {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum Country {
|
||||
UNKNOWN,
|
||||
A1,
|
||||
@ -527,7 +527,7 @@ impl<D: de::Deserializer<E>, E> de::Deserialize<D, E> for Country {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Show, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
#[derive(Debug, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
#[derive_serialize]
|
||||
#[derive_deserialize]
|
||||
struct Log {
|
||||
|
@ -7,7 +7,7 @@ extern crate serde;
|
||||
extern crate "rustc-serialize" as rustc_serialize;
|
||||
extern crate test;
|
||||
|
||||
use std::fmt::Show;
|
||||
use std::fmt::Debug;
|
||||
use std::collections::HashMap;
|
||||
use test::Bencher;
|
||||
|
||||
@ -17,7 +17,7 @@ use serde::de::{Deserializer, Deserialize};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
pub enum Error {
|
||||
EndOfStream,
|
||||
SyntaxError,
|
||||
@ -226,7 +226,7 @@ mod deserializer {
|
||||
|
||||
use serde::de;
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
enum State {
|
||||
StartState,
|
||||
KeyOrEndState,
|
||||
@ -321,7 +321,7 @@ mod deserializer {
|
||||
|
||||
fn run_decoder<
|
||||
D: Decoder<Error=Error>,
|
||||
T: Clone + PartialEq + Show + Decodable
|
||||
T: Clone + PartialEq + Debug + Decodable
|
||||
>(mut d: D, value: T) {
|
||||
let v = Decodable::decode(&mut d);
|
||||
|
||||
@ -360,8 +360,8 @@ fn bench_decoder_100(b: &mut Bencher) {
|
||||
|
||||
fn run_deserializer<
|
||||
D: Deserializer<E>,
|
||||
E: Show,
|
||||
T: Clone + PartialEq + Show + Deserialize<D, E>
|
||||
E: Debug,
|
||||
T: Clone + PartialEq + Debug + Deserialize<D, E>
|
||||
>(mut d: D, value: T) {
|
||||
let v: T = Deserialize::deserialize(&mut d).unwrap();
|
||||
|
||||
|
@ -16,7 +16,7 @@ use serde::de::{Deserializer, Deserialize};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Clone, PartialEq, Show, RustcDecodable)]
|
||||
#[derive(Clone, PartialEq, Debug, RustcDecodable)]
|
||||
#[derive_deserialize]
|
||||
struct Inner {
|
||||
a: (),
|
||||
@ -26,7 +26,7 @@ struct Inner {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Clone, PartialEq, Show, RustcDecodable)]
|
||||
#[derive(Clone, PartialEq, Debug, RustcDecodable)]
|
||||
#[derive_deserialize]
|
||||
struct Outer {
|
||||
inner: Vec<Inner>,
|
||||
@ -34,7 +34,7 @@ struct Outer {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Show)]
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
EndOfStream,
|
||||
SyntaxError(String),
|
||||
@ -63,7 +63,7 @@ mod decoder {
|
||||
OptionState,
|
||||
};
|
||||
|
||||
#[derive(Show)]
|
||||
#[derive(Debug)]
|
||||
enum State {
|
||||
OuterState(Outer),
|
||||
InnerState(Inner),
|
||||
@ -339,7 +339,7 @@ mod deserializer {
|
||||
EndState,
|
||||
};
|
||||
|
||||
#[derive(Show)]
|
||||
#[derive(Debug)]
|
||||
enum State {
|
||||
OuterState(Outer),
|
||||
InnerState(Inner),
|
||||
|
@ -7,7 +7,7 @@ extern crate serde;
|
||||
extern crate "rustc-serialize" as rustc_serialize;
|
||||
extern crate test;
|
||||
|
||||
use std::fmt::Show;
|
||||
use std::fmt::Debug;
|
||||
use test::Bencher;
|
||||
|
||||
use rustc_serialize::{Decoder, Decodable};
|
||||
@ -16,7 +16,7 @@ use serde::de::{Deserializer, Deserialize};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
pub enum Error {
|
||||
EndOfStream,
|
||||
SyntaxError,
|
||||
@ -353,7 +353,7 @@ mod deserializer {
|
||||
|
||||
use serde::de;
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
enum State {
|
||||
StartState,
|
||||
SepOrEndState,
|
||||
@ -513,7 +513,7 @@ mod deserializer {
|
||||
|
||||
fn run_decoder<
|
||||
D: Decoder<Error=Error>,
|
||||
T: Clone + PartialEq + Show + Decodable
|
||||
T: Clone + PartialEq + Debug + Decodable
|
||||
>(mut d: D, value: T) {
|
||||
let v = Decodable::decode(&mut d);
|
||||
|
||||
@ -522,8 +522,8 @@ fn run_decoder<
|
||||
|
||||
fn run_deserializer<
|
||||
D: Deserializer<E>,
|
||||
E: Show,
|
||||
T: Clone + PartialEq + Show + Deserialize<D, E>
|
||||
E: Debug,
|
||||
T: Clone + PartialEq + Debug + Deserialize<D, E>
|
||||
>(mut d: D, value: T) {
|
||||
let v: T = Deserialize::deserialize(&mut d).unwrap();
|
||||
|
||||
|
@ -66,7 +66,7 @@ impl de::Deserialize for HttpField {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Show, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
#[derive(Debug, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
#[derive_serialize]
|
||||
//#[derive_deserialize]
|
||||
struct Http {
|
||||
@ -135,7 +135,7 @@ impl de::Deserialize for Http {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum HttpProtocol {
|
||||
HTTP_PROTOCOL_UNKNOWN,
|
||||
HTTP10,
|
||||
@ -175,7 +175,7 @@ impl de::Deserialize for HttpProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum HttpMethod {
|
||||
METHOD_UNKNOWN,
|
||||
GET,
|
||||
@ -223,7 +223,7 @@ impl de::Deserialize for HttpMethod {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum CacheStatus {
|
||||
CACHESTATUS_UNKNOWN,
|
||||
Miss,
|
||||
@ -298,7 +298,7 @@ impl de::Deserialize for OriginField {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Show, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
#[derive(Debug, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
#[derive_serialize]
|
||||
//#[derive_deserialize]
|
||||
struct Origin {
|
||||
@ -347,7 +347,7 @@ impl Deserialize for Origin {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum OriginProtocol {
|
||||
ORIGIN_PROTOCOL_UNKNOWN,
|
||||
HTTP,
|
||||
@ -387,7 +387,7 @@ impl de::Deserialize for OriginProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum ZonePlan {
|
||||
ZONEPLAN_UNKNOWN,
|
||||
FREE,
|
||||
@ -429,7 +429,7 @@ impl de::Deserialize for ZonePlan {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Show, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum Country {
|
||||
UNKNOWN,
|
||||
A1,
|
||||
@ -772,7 +772,7 @@ impl de::Deserialize for LogField {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Show, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
#[derive(Debug, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
#[derive_serialize]
|
||||
//#[derive_deserialize]
|
||||
struct Log {
|
||||
|
@ -665,7 +665,7 @@ mod tests {
|
||||
use std::iter;
|
||||
use std::vec;
|
||||
|
||||
#[derive(Show)]
|
||||
#[derive(Debug)]
|
||||
enum Token<'a> {
|
||||
Bool(bool),
|
||||
Isize(isize),
|
||||
@ -715,7 +715,7 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
enum Error {
|
||||
SyntaxError,
|
||||
EndOfStreamError,
|
||||
@ -973,7 +973,7 @@ mod tests {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
struct NamedUnit;
|
||||
|
||||
impl Deserialize for NamedUnit {
|
||||
@ -1015,7 +1015,7 @@ mod tests {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
struct NamedSeq(i32, i32, i32);
|
||||
|
||||
impl Deserialize for NamedSeq {
|
||||
@ -1067,7 +1067,7 @@ mod tests {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
struct NamedMap {
|
||||
a: i32,
|
||||
b: i32,
|
||||
@ -1152,7 +1152,7 @@ mod tests {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
enum Enum {
|
||||
Unit,
|
||||
Seq(i32, i32, i32),
|
||||
|
@ -529,7 +529,7 @@ pub fn from_str<'a, T>(s: &'a str) -> Result<T, Error>
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::str;
|
||||
use std::fmt::Show;
|
||||
use std::fmt::Debug;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use de::Deserialize;
|
||||
@ -545,7 +545,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn test_parse_ok<'a, T>(errors: Vec<(&'a str, T)>)
|
||||
where T: PartialEq + Show + Deserialize,
|
||||
where T: PartialEq + Debug + Deserialize,
|
||||
{
|
||||
for (s, value) in errors.into_iter() {
|
||||
let v: Result<T, Error> = from_str(s);
|
||||
@ -559,7 +559,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn test_parse_err<'a, T>(errors: Vec<(&'a str, Error)>)
|
||||
where T: PartialEq + Show + Deserialize
|
||||
where T: PartialEq + Debug + Deserialize
|
||||
{
|
||||
for (s, err) in errors.into_iter() {
|
||||
let v: Result<T, Error> = from_str(s);
|
||||
|
@ -37,7 +37,7 @@ pub enum ErrorCode {
|
||||
UnrecognizedHex,
|
||||
}
|
||||
|
||||
impl fmt::Show for ErrorCode {
|
||||
impl fmt::Debug for ErrorCode {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
//ErrorCode::ConversionError(ref token) => write!(f, "failed to convert {}", token),
|
||||
@ -75,7 +75,7 @@ impl fmt::Show for ErrorCode {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub enum Error {
|
||||
/// msg, line, col
|
||||
SyntaxError(ErrorCode, usize, usize),
|
||||
|
@ -57,7 +57,7 @@ impl<'a, 'b> io::Writer for WriterFormatter<'a, 'b> {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for Value {
|
||||
impl fmt::Debug for Value {
|
||||
/// Serializes a json value into a string
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
let mut wr = WriterFormatter { inner: f };
|
||||
|
@ -651,7 +651,7 @@ mod tests {
|
||||
use std::vec;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub enum Token<'a> {
|
||||
Bool(bool),
|
||||
Isize(isize),
|
||||
|
12
src/de.rs
12
src/de.rs
@ -18,7 +18,7 @@ use std::rc::Rc;
|
||||
use std::string;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub enum Token {
|
||||
Null,
|
||||
Bool(bool),
|
||||
@ -138,7 +138,7 @@ static COMPOUND_TOKEN_KINDS: &'static [TokenKind] = &[
|
||||
TokenKind::MapStartKind,
|
||||
];
|
||||
|
||||
impl ::std::fmt::Show for TokenKind {
|
||||
impl ::std::fmt::Debug for TokenKind {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
match *self {
|
||||
TokenKind::NullKind => "Null".fmt(f),
|
||||
@ -1091,7 +1091,7 @@ mod tests {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Clone, PartialEq, Show, RustcDecodable)]
|
||||
#[derive(Clone, PartialEq, Debug, RustcDecodable)]
|
||||
struct Inner {
|
||||
a: (),
|
||||
b: usize,
|
||||
@ -1133,7 +1133,7 @@ mod tests {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Clone, PartialEq, Show, RustcDecodable)]
|
||||
#[derive(Clone, PartialEq, Debug, RustcDecodable)]
|
||||
struct Outer {
|
||||
inner: Vec<Inner>,
|
||||
}
|
||||
@ -1166,7 +1166,7 @@ mod tests {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Clone, PartialEq, Show, RustcDecodable)]
|
||||
#[derive(Clone, PartialEq, Debug, RustcDecodable)]
|
||||
enum Animal {
|
||||
Dog,
|
||||
Frog(string::String, isize)
|
||||
@ -1193,7 +1193,7 @@ mod tests {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Show)]
|
||||
#[derive(Debug)]
|
||||
enum Error {
|
||||
EndOfStream,
|
||||
SyntaxError(Vec<TokenKind>),
|
||||
|
@ -7,7 +7,7 @@ use de;
|
||||
|
||||
use super::error::{Error, ErrorCode};
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
enum State {
|
||||
// Parse a value.
|
||||
Value,
|
||||
|
@ -40,7 +40,7 @@ pub enum ErrorCode {
|
||||
UnrecognizedHex,
|
||||
}
|
||||
|
||||
impl fmt::Show for ErrorCode {
|
||||
impl fmt::Debug for ErrorCode {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
ErrorCode::ConversionError(ref token) => write!(f, "failed to convert {:?}", token),
|
||||
@ -78,7 +78,7 @@ impl fmt::Show for ErrorCode {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub enum Error {
|
||||
/// msg, line, col
|
||||
SyntaxError(ErrorCode, usize, usize),
|
||||
|
@ -318,7 +318,7 @@ pub mod error;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::fmt::Show;
|
||||
use std::fmt::Debug;
|
||||
use std::io;
|
||||
use std::str;
|
||||
use std::string;
|
||||
@ -357,7 +357,7 @@ mod tests {
|
||||
})
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
#[derive_serialize]
|
||||
#[derive_deserialize]
|
||||
enum Animal {
|
||||
@ -386,7 +386,7 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
#[derive_serialize]
|
||||
#[derive_deserialize]
|
||||
struct Inner {
|
||||
@ -407,7 +407,7 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
#[derive_serialize]
|
||||
#[derive_deserialize]
|
||||
struct Outer {
|
||||
@ -425,7 +425,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn test_encode_ok<
|
||||
T: PartialEq + Show + ToJson + ser::Serialize<super::Serializer<Vec<u8>>, io::IoError>
|
||||
T: PartialEq + Debug + ToJson + ser::Serialize<super::Serializer<Vec<u8>>, io::IoError>
|
||||
>(errors: &[(T, &str)]) {
|
||||
for &(ref value, out) in errors.iter() {
|
||||
let out = out.to_string();
|
||||
@ -439,7 +439,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn test_pretty_encode_ok<
|
||||
T: PartialEq + Show + ToJson + ser::Serialize<super::PrettySerializer<Vec<u8>>, io::IoError>
|
||||
T: PartialEq + Debug + ToJson + ser::Serialize<super::PrettySerializer<Vec<u8>>, old_io::IoError>
|
||||
>(errors: &[(T, &str)]) {
|
||||
for &(ref value, out) in errors.iter() {
|
||||
let out = out.to_string();
|
||||
@ -776,7 +776,7 @@ mod tests {
|
||||
// FIXME (#5527): these could be merged once UFCS is finished.
|
||||
fn test_parse_err<
|
||||
'a,
|
||||
T: Show + de::Deserialize<Parser<str::Bytes<'a>>, Error>
|
||||
T: Debug + de::Deserialize<Parser<str::Bytes<'a>>, Error>
|
||||
>(errors: &[(&'a str, Error)]) {
|
||||
for &(s, ref err) in errors.iter() {
|
||||
let v: Result<T, Error> = from_str(s);
|
||||
@ -786,7 +786,7 @@ mod tests {
|
||||
|
||||
fn test_parse_ok<
|
||||
'a,
|
||||
T: PartialEq + Show + ToJson + de::Deserialize<Parser<str::Bytes<'a>>, Error>
|
||||
T: PartialEq + Debug + ToJson + de::Deserialize<Parser<str::Bytes<'a>>, Error>
|
||||
>(errors: &[(&'a str, T)]) {
|
||||
for &(s, ref value) in errors.iter() {
|
||||
let v: T = from_str(s).unwrap();
|
||||
@ -798,7 +798,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn test_json_deserialize_ok<
|
||||
T: PartialEq + Show + ToJson + de::Deserialize<value::Deserializer, Error>
|
||||
T: PartialEq + Debug + ToJson + de::Deserialize<value::Deserializer, Error>
|
||||
>(errors: &[T]) {
|
||||
for value in errors.iter() {
|
||||
let v: T = from_json(value.to_json()).unwrap();
|
||||
@ -1103,7 +1103,7 @@ mod tests {
|
||||
("\"jodhpurs\"", Some("jodhpurs".to_string())),
|
||||
]);
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
#[derive_serialize]
|
||||
#[derive_deserialize]
|
||||
struct Foo {
|
||||
|
@ -81,7 +81,7 @@ fn spaces<W: Writer>(wr: &mut W, mut n: usize) -> IoResult<()> {
|
||||
}
|
||||
|
||||
/*
|
||||
#[derive(Show)]
|
||||
#[derive(Debug)]
|
||||
enum SerializerState {
|
||||
ValueState,
|
||||
TupleState,
|
||||
|
@ -226,7 +226,7 @@ impl<'a, 'b> Writer for WriterFormatter<'a, 'b> {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for Value {
|
||||
impl fmt::Debug for Value {
|
||||
/// Serializes a json value into a string
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
let wr = WriterFormatter { inner: f };
|
||||
|
10
src/ser.rs
10
src/ser.rs
@ -328,7 +328,7 @@ mod tests {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Clone, PartialEq, Show, RustcDecodable)]
|
||||
#[derive(Clone, PartialEq, Debug, RustcDecodable)]
|
||||
#[derive_serialize]
|
||||
struct Inner {
|
||||
a: (),
|
||||
@ -338,7 +338,7 @@ mod tests {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Clone, PartialEq, Show, RustcDecodable)]
|
||||
#[derive(Clone, PartialEq, Debug, RustcDecodable)]
|
||||
#[derive_serialize]
|
||||
struct Outer {
|
||||
inner: Vec<Inner>,
|
||||
@ -346,7 +346,7 @@ mod tests {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Clone, PartialEq, Show, RustcDecodable)]
|
||||
#[derive(Clone, PartialEq, Debug, RustcDecodable)]
|
||||
#[derive_serialize]
|
||||
enum Animal {
|
||||
Dog,
|
||||
@ -355,7 +355,7 @@ mod tests {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub enum Token<'a> {
|
||||
Null,
|
||||
Bool(bool),
|
||||
@ -395,7 +395,7 @@ mod tests {
|
||||
MapEnd,
|
||||
}
|
||||
|
||||
#[derive(Show)]
|
||||
#[derive(Debug)]
|
||||
#[allow(dead_code)]
|
||||
enum Error {
|
||||
EndOfStream,
|
||||
|
@ -4,7 +4,7 @@ extern crate serde;
|
||||
#[plugin]
|
||||
extern crate serde_macros;
|
||||
|
||||
#[derive(PartialEq, Show)]
|
||||
#[derive(PartialEq, Debug)]
|
||||
#[derive_serialize]
|
||||
#[derive_deserialize]
|
||||
struct Test {
|
||||
|
Loading…
x
Reference in New Issue
Block a user