replace impls with deriving where applicable

This commit is contained in:
Andrew Paseltiner
2013-03-22 16:09:20 -04:00
parent 2b83defa4a
commit 45677eebf2
6 changed files with 7 additions and 63 deletions

View File

@@ -35,6 +35,7 @@ pub enum Json {
pub type List = ~[Json];
pub type Object = LinearMap<~str, Json>;
#[deriving(Eq)]
pub struct Error {
line: uint,
col: uint,
@@ -1060,15 +1061,6 @@ impl Ord for Json {
fn gt(&self, other: &Json) -> bool { (*other).lt(&(*self)) }
}
impl Eq for Error {
fn eq(&self, other: &Error) -> bool {
(*self).line == other.line &&
(*self).col == other.col &&
(*self).msg == other.msg
}
fn ne(&self, other: &Error) -> bool { !(*self).eq(other) }
}
trait ToJson { fn to_json(&self) -> Json; }
impl ToJson for Json {