diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-05-29 17:45:07 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-30 15:52:24 -0700 |
| commit | 748bc3ca49de8ab0b890726120c40567094e43fc (patch) | |
| tree | a205dcd5582cbecbb1a02fa3ed1ebfdcc85ff881 /src/libserialize/json.rs | |
| parent | f4fa7c8a07a96cc9d0aae0bfc6515fb747f25341 (diff) | |
| download | rust-748bc3ca49de8ab0b890726120c40567094e43fc.tar.gz rust-748bc3ca49de8ab0b890726120c40567094e43fc.zip | |
std: Rename {Eq,Ord} to Partial{Eq,Ord}
This is part of the ongoing renaming of the equality traits. See #12517 for more
details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord}
or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}.
cc #12517
[breaking-change]
Diffstat (limited to 'src/libserialize/json.rs')
| -rw-r--r-- | src/libserialize/json.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 09ba46bf0c7..5e23c9c3451 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -249,7 +249,7 @@ use Encodable; use collections::{HashMap, TreeMap}; /// Represents a json value -#[deriving(Clone, Eq)] +#[deriving(Clone, PartialEq)] pub enum Json { Number(f64), String(String), @@ -263,7 +263,7 @@ pub type List = Vec<Json>; pub type Object = TreeMap<String, Json>; /// The errors that can arise while parsing a JSON stream. -#[deriving(Clone, Eq)] +#[deriving(Clone, PartialEq)] pub enum ErrorCode { InvalidSyntax, InvalidNumber, @@ -283,7 +283,7 @@ pub enum ErrorCode { NotUtf8, } -#[deriving(Clone, Eq, Show)] +#[deriving(Clone, PartialEq, Show)] pub enum ParserError { /// msg, line, col SyntaxError(ErrorCode, uint, uint), @@ -293,7 +293,7 @@ pub enum ParserError { // Builder and Parser have the same errors. pub type BuilderError = ParserError; -#[deriving(Clone, Eq, Show)] +#[deriving(Clone, PartialEq, Show)] pub enum DecoderError { ParseError(ParserError), ExpectedError(String, String), @@ -975,7 +975,7 @@ impl Json { } /// The output of the streaming parser. -#[deriving(Eq, Clone, Show)] +#[deriving(PartialEq, Clone, Show)] pub enum JsonEvent { ObjectStart, ObjectEnd, @@ -988,7 +988,7 @@ pub enum JsonEvent { Error(ParserError), } -#[deriving(Eq, Show)] +#[deriving(PartialEq, Show)] enum ParserState { // Parse a value in a list, true means first element. ParseList(bool), @@ -1017,7 +1017,7 @@ pub struct Stack { /// StackElements compose a Stack. /// For example, Key("foo"), Key("bar"), Index(3) and Key("x") are the /// StackElements compositing the stack that represents foo.bar[3].x -#[deriving(Eq, Clone, Show)] +#[deriving(PartialEq, Clone, Show)] pub enum StackElement<'l> { Index(u32), Key(&'l str), @@ -1025,7 +1025,7 @@ pub enum StackElement<'l> { // Internally, Key elements are stored as indices in a buffer to avoid // allocating a string for every member of an object. -#[deriving(Eq, Clone, Show)] +#[deriving(PartialEq, Clone, Show)] enum InternalStackElement { InternalIndex(u32), InternalKey(u16, u16), // start, size @@ -2082,7 +2082,7 @@ impl ::Decoder<DecoderError> for Decoder { } /// Test if two json values are less than one another -impl Ord for Json { +impl PartialOrd for Json { fn lt(&self, other: &Json) -> bool { match *self { Number(f0) => { @@ -2288,20 +2288,20 @@ mod tests { use std::io; use collections::TreeMap; - #[deriving(Eq, Encodable, Decodable, Show)] + #[deriving(PartialEq, Encodable, Decodable, Show)] enum Animal { Dog, Frog(String, int) } - #[deriving(Eq, Encodable, Decodable, Show)] + #[deriving(PartialEq, Encodable, Decodable, Show)] struct Inner { a: (), b: uint, c: Vec<String>, } - #[deriving(Eq, Encodable, Decodable, Show)] + #[deriving(PartialEq, Encodable, Decodable, Show)] struct Outer { inner: Vec<Inner>, } |
