Skip to content

Commit 6c4e219

Browse files
committed
---
yaml --- r: 112891 b: refs/heads/auto c: b537028 h: refs/heads/master i: 112889: 2a9da16 112887: 3326712 v: v3
1 parent 0cca70d commit 6c4e219

File tree

4 files changed

+40
-40
lines changed

4 files changed

+40
-40
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: e4ad24f1b2f16fad780bdb433bfaaea80eb7fd1d
16+
refs/heads/auto: b537028116c8f5d98ec6e522ba5fe44067d7234e
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ fn eq(xs: &List, ys: &List) -> bool {
11971197
match (xs, ys) {
11981198
// If we have reached the end of both lists, they are equal.
11991199
(&Nil, &Nil) => true,
1200-
// If the current elements of both lists are equal, keep going.
1200+
// If the current element in both lists is equal, keep going.
12011201
(&Cons(x, ~ref next_xs), &Cons(y, ~ref next_ys))
12021202
if x == y => eq(next_xs, next_ys),
12031203
// If the current elements are not equal, the lists are not equal.
@@ -1304,7 +1304,7 @@ fn eq<T: Eq>(xs: &List<T>, ys: &List<T>) -> bool {
13041304
match (xs, ys) {
13051305
// If we have reached the end of both lists, they are equal.
13061306
(&Nil, &Nil) => true,
1307-
// If the current elements of both lists are equal, keep going.
1307+
// If the current element in both lists is equal, keep going.
13081308
(&Cons(ref x, ~ref next_xs), &Cons(ref y, ~ref next_ys))
13091309
if x == y => eq(next_xs, next_ys),
13101310
// If the current elements are not equal, the lists are not equal.
@@ -1333,7 +1333,7 @@ impl<T: Eq> Eq for List<T> {
13331333
match (self, ys) {
13341334
// If we have reached the end of both lists, they are equal.
13351335
(&Nil, &Nil) => true,
1336-
// If the current elements of both lists are equal, keep going.
1336+
// If the current element in both lists is equal, keep going.
13371337
(&Cons(ref x, ~ref next_xs), &Cons(ref y, ~ref next_ys))
13381338
if x == y => next_xs == next_ys,
13391339
// If the current elements are not equal, the lists are not equal.
@@ -2965,7 +2965,7 @@ use farm::*;
29652965
~~~
29662966

29672967
> *Note:* This feature of the compiler is currently gated behind the
2968-
> `#[feature(globs)]` directive. More about these directives can be found in
2968+
> `#![feature(globs)]` directive. More about these directives can be found in
29692969
> the manual.
29702970
29712971
However, that's not all. You can also rename an item while you're bringing it into scope:

branches/auto/src/libserialize/json.rs

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2205,10 +2205,6 @@ impl ToJson for ~str {
22052205
fn to_json(&self) -> Json { String((*self).clone()) }
22062206
}
22072207

2208-
impl ToJson for StrBuf {
2209-
fn to_json(&self) -> Json { String((*self).as_slice().into_owned()) }
2210-
}
2211-
22122208
impl<A:ToJson,B:ToJson> ToJson for (A, B) {
22132209
fn to_json(&self) -> Json {
22142210
match *self {
@@ -2647,25 +2643,41 @@ mod tests {
26472643

26482644
#[test]
26492645
fn test_decode_str() {
2650-
let s = [("\"\"", ""),
2651-
("\"foo\"", "foo"),
2652-
("\"\\\"\"", "\""),
2653-
("\"\\b\"", "\x08"),
2654-
("\"\\n\"", "\n"),
2655-
("\"\\r\"", "\r"),
2656-
("\"\\t\"", "\t"),
2657-
("\"\\u12ab\"", "\u12ab"),
2658-
("\"\\uAB12\"", "\uAB12")];
2659-
2660-
for &(i, o) in s.iter() {
2661-
let mut decoder = Decoder::new(from_str(i).unwrap());
2662-
let v: StrBuf = Decodable::decode(&mut decoder).unwrap();
2663-
assert_eq!(v.as_slice(), o);
2664-
2665-
let mut decoder = Decoder::new(from_str(i).unwrap());
2666-
let v: ~str = Decodable::decode(&mut decoder).unwrap();
2667-
assert_eq!(v, o.to_owned());
2668-
}
2646+
let mut decoder = Decoder::new(from_str("\"\"").unwrap());
2647+
let v: ~str = Decodable::decode(&mut decoder).unwrap();
2648+
assert_eq!(v, "".to_owned());
2649+
2650+
let mut decoder = Decoder::new(from_str("\"foo\"").unwrap());
2651+
let v: ~str = Decodable::decode(&mut decoder).unwrap();
2652+
assert_eq!(v, "foo".to_owned());
2653+
2654+
let mut decoder = Decoder::new(from_str("\"\\\"\"").unwrap());
2655+
let v: ~str = Decodable::decode(&mut decoder).unwrap();
2656+
assert_eq!(v, "\"".to_owned());
2657+
2658+
let mut decoder = Decoder::new(from_str("\"\\b\"").unwrap());
2659+
let v: ~str = Decodable::decode(&mut decoder).unwrap();
2660+
assert_eq!(v, "\x08".to_owned());
2661+
2662+
let mut decoder = Decoder::new(from_str("\"\\n\"").unwrap());
2663+
let v: ~str = Decodable::decode(&mut decoder).unwrap();
2664+
assert_eq!(v, "\n".to_owned());
2665+
2666+
let mut decoder = Decoder::new(from_str("\"\\r\"").unwrap());
2667+
let v: ~str = Decodable::decode(&mut decoder).unwrap();
2668+
assert_eq!(v, "\r".to_owned());
2669+
2670+
let mut decoder = Decoder::new(from_str("\"\\t\"").unwrap());
2671+
let v: ~str = Decodable::decode(&mut decoder).unwrap();
2672+
assert_eq!(v, "\t".to_owned());
2673+
2674+
let mut decoder = Decoder::new(from_str("\"\\u12ab\"").unwrap());
2675+
let v: ~str = Decodable::decode(&mut decoder).unwrap();
2676+
assert_eq!(v, "\u12ab".to_owned());
2677+
2678+
let mut decoder = Decoder::new(from_str("\"\\uAB12\"").unwrap());
2679+
let v: ~str = Decodable::decode(&mut decoder).unwrap();
2680+
assert_eq!(v, "\uAB12".to_owned());
26692681
}
26702682

26712683
#[test]

branches/auto/src/libserialize/serialize.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -313,18 +313,6 @@ impl<E, D:Decoder<E>> Decodable<D, E> for ~str {
313313
}
314314
}
315315

316-
impl<E, S:Encoder<E>> Encodable<S, E> for StrBuf {
317-
fn encode(&self, s: &mut S) -> Result<(), E> {
318-
s.emit_str(self.as_slice())
319-
}
320-
}
321-
322-
impl<E, D:Decoder<E>> Decodable<D, E> for StrBuf {
323-
fn decode(d: &mut D) -> Result<StrBuf, E> {
324-
Ok(StrBuf::from_str(try!(d.read_str())))
325-
}
326-
}
327-
328316
impl<E, S:Encoder<E>> Encodable<S, E> for f32 {
329317
fn encode(&self, s: &mut S) -> Result<(), E> {
330318
s.emit_f32(*self)

0 commit comments

Comments
 (0)