Skip to content

Commit 7938f3a

Browse files
committed
---
yaml --- r: 47582 b: refs/heads/try c: 62651df h: refs/heads/master v: v3
1 parent ea1248c commit 7938f3a

File tree

9 files changed

+18
-54
lines changed

9 files changed

+18
-54
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
5-
refs/heads/try: 59de3853be3b7d9e5306522bdfdb76be69555703
5+
refs/heads/try: 62651df2b482af4dc98b0aec6c5f1ad112fab8ec
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libcore/io.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,17 +1442,15 @@ mod tests {
14421442
fn bytes_buffer_overwrite() {
14431443
let wr = BytesWriter();
14441444
wr.write(~[0u8, 1u8, 2u8, 3u8]);
1445-
fail_unless!(wr.bytes.borrow(|bytes| bytes == ~[0u8, 1u8, 2u8, 3u8]));
1445+
fail_unless!(wr.bytes == ~[0u8, 1u8, 2u8, 3u8]);
14461446
wr.seek(-2, SeekCur);
14471447
wr.write(~[4u8, 5u8, 6u8, 7u8]);
1448-
fail_unless!(wr.bytes.borrow(|bytes| bytes ==
1449-
~[0u8, 1u8, 4u8, 5u8, 6u8, 7u8]));
1448+
fail_unless!(wr.bytes == ~[0u8, 1u8, 4u8, 5u8, 6u8, 7u8]);
14501449
wr.seek(-2, SeekEnd);
14511450
wr.write(~[8u8]);
14521451
wr.seek(1, SeekSet);
14531452
wr.write(~[9u8]);
1454-
fail_unless!(wr.bytes.borrow(|bytes| bytes ==
1455-
~[0u8, 9u8, 4u8, 5u8, 8u8, 7u8]));
1453+
fail_unless!(wr.bytes == ~[0u8, 9u8, 4u8, 5u8, 8u8, 7u8]);
14561454
}
14571455
14581456
#[test]

branches/try/src/libstd/flatpipes.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -452,13 +452,10 @@ pub mod flatteners {
452452
453453
pub fn serialize_value<D: Encoder + FromWriter,
454454
T: Encodable<D>>(val: &T) -> ~[u8] {
455-
let mut bytes_writer = BytesWriter();
456-
let writer = @bytes_writer as @Writer;
457-
let ser = FromWriter::from_writer(writer);
458-
val.encode(&ser);
459-
let mut ret = ~[];
460-
ret <-> bytes_writer.bytes;
461-
return ret;
455+
do io::with_bytes_writer |writer| {
456+
let ser = FromWriter::from_writer(writer);
457+
val.encode(&ser);
458+
}
462459
}
463460
464461
pub trait FromReader {
@@ -652,7 +649,7 @@ mod test {
652649
653650
chan.send(10);
654651
655-
let bytes = chan.byte_chan.writer.bytes.get();
652+
let bytes = copy chan.byte_chan.writer.bytes;
656653
657654
let reader = BufReader::new(bytes);
658655
let port = serial::reader_port(reader);
@@ -698,7 +695,7 @@ mod test {
698695
699696
chan.send(10);
700697
701-
let bytes = chan.byte_chan.writer.bytes.get();
698+
let bytes = copy chan.byte_chan.writer.bytes;
702699
703700
let reader = BufReader::new(bytes);
704701
let port = pod::reader_port(reader);

branches/try/src/libstd/json.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,8 +1311,7 @@ mod tests {
13111311
}
13121312
}
13131313
}
1314-
check_equal(str::from_bytes(bw.bytes.data),
1315-
~"[\"frog\",[\"Henry\",349]]");
1314+
check_equal(str::from_bytes(bw.bytes), ~"[\"frog\",[\"Henry\",349]]");
13161315
}
13171316
13181317
#[test]
@@ -1327,8 +1326,7 @@ mod tests {
13271326
}
13281327
}
13291328
}
1330-
check_equal(str::from_bytes(bw.bytes.data),
1331-
~"\"jodhpurs\"");
1329+
check_equal(str::from_bytes(bw.bytes), ~"\"jodhpurs\"");
13321330
}
13331331

13341332
#[test]
@@ -1340,8 +1338,7 @@ mod tests {
13401338
do encoder.emit_enum_variant (~"None",37,1242) {
13411339
}
13421340
}
1343-
check_equal(str::from_bytes(bw.bytes.data),
1344-
~"null");
1341+
check_equal(str::from_bytes(bw.bytes), ~"null");
13451342
}
13461343
13471344
#[test]

branches/try/src/libsyntax/parse/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,9 @@ mod test {
303303
use util::testing::*;
304304

305305
#[test] fn to_json_str (val: Encodable<std::json::Encoder>) -> ~str {
306-
let bw = @io::BytesWriter();
307-
val.encode(~std::json::Encoder(bw as io::Writer));
308-
str::from_bytes(bw.bytes.data)
306+
do io::with_str_writer |writer| {
307+
val.encode(~std::json::Encoder(writer));
308+
}
309309
}
310310

311311
#[test] fn alltts () {

branches/try/src/test/run-pass/call-closure-from-overloaded-op.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
fn foo() -> int { 22 }
1212

1313
pub fn main() {
14-
let x: ~[@fn() -> int] = ~[];
14+
let mut x: ~[@fn() -> int] = ~[];
1515
x.push(foo);
1616
fail_unless!((x[0])() == 22);
1717
}

branches/try/src/test/run-pass/issue-2631-b.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ extern mod req;
1515
extern mod std;
1616

1717
use req::*;
18-
use std::oldmap::*;
1918
use std::oldmap::HashMap;
2019

2120
pub fn main() {
2221
let v = ~[@~"hi"];
2322
let m: req::header_map = HashMap();
24-
m.insert(~"METHOD", @mut ~[v]);
23+
m.insert(~"METHOD", @mut v);
2524
request::<int>(m);
2625
}
-15.8 KB
Binary file not shown.

branches/try/src/test/run-pass/issue-5275.rs

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)