1
Fork 0

libstd: Remove all uses of pure from libstd. rs=depure

This commit is contained in:
Patrick Walton 2013-03-21 21:34:30 -07:00
parent be9bddd463
commit c1084091d4
25 changed files with 353 additions and 353 deletions

View file

@ -345,7 +345,7 @@ pub fn to_writer(wr: @io::Writer, json: &Json) {
}
/// Encodes a json value into a string
pub pure fn to_str(json: &Json) -> ~str {
pub fn to_str(json: &Json) -> ~str {
unsafe {
// ugh, should be safe
io::with_str_writer(|wr| to_writer(wr, json))
@ -947,7 +947,7 @@ impl serialize::Decoder for Decoder/&self {
}
impl Eq for Json {
pure fn eq(&self, other: &Json) -> bool {
fn eq(&self, other: &Json) -> bool {
match (self) {
&Number(f0) =>
match other { &Number(f1) => f0 == f1, _ => false },
@ -980,12 +980,12 @@ impl Eq for Json {
}
}
}
pure fn ne(&self, other: &Json) -> bool { !self.eq(other) }
fn ne(&self, other: &Json) -> bool { !self.eq(other) }
}
/// Test if two json values are less than one another
impl Ord for Json {
pure fn lt(&self, other: &Json) -> bool {
fn lt(&self, other: &Json) -> bool {
match (*self) {
Number(f0) => {
match *other {
@ -1055,18 +1055,18 @@ impl Ord for Json {
}
}
}
pure fn le(&self, other: &Json) -> bool { !(*other).lt(&(*self)) }
pure fn ge(&self, other: &Json) -> bool { !(*self).lt(other) }
pure fn gt(&self, other: &Json) -> bool { (*other).lt(&(*self)) }
fn le(&self, other: &Json) -> bool { !(*other).lt(&(*self)) }
fn ge(&self, other: &Json) -> bool { !(*self).lt(other) }
fn gt(&self, other: &Json) -> bool { (*other).lt(&(*self)) }
}
impl Eq for Error {
pure fn eq(&self, other: &Error) -> bool {
fn eq(&self, other: &Error) -> bool {
(*self).line == other.line &&
(*self).col == other.col &&
(*self).msg == other.msg
}
pure fn ne(&self, other: &Error) -> bool { !(*self).eq(other) }
fn ne(&self, other: &Error) -> bool { !(*self).eq(other) }
}
trait ToJson { fn to_json(&self) -> Json; }
@ -1191,11 +1191,11 @@ impl<A:ToJson> ToJson for Option<A> {
}
impl to_str::ToStr for Json {
pure fn to_str(&self) -> ~str { to_str(self) }
fn to_str(&self) -> ~str { to_str(self) }
}
impl to_str::ToStr for Error {
pure fn to_str(&self) -> ~str {
fn to_str(&self) -> ~str {
fmt!("%u:%u: %s", self.line, self.col, *self.msg)
}
}