Skip to content

Commit 16288a1

Browse files
committed
---
yaml --- r: 114139 b: refs/heads/master c: 7abf6f1 h: refs/heads/master i: 114137: d583736 114135: 4cfe675 v: v3
1 parent 90b4d02 commit 16288a1

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 6415d06616a5203c76d9885b11b42fa95a639b41
2+
refs/heads/master: 7abf6f1346dd837d5ee573a09dc71218d4ffd935
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ec0258a381b88b5574e3f8ce72ae553ac3a574b7
55
refs/heads/try: 7c6c492fb2af9a85f21ff952942df3523b22fd17

trunk/src/librand/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,15 +260,15 @@ pub trait Rng {
260260
///
261261
/// println!("{}", task_rng().gen_ascii_str(10));
262262
/// ```
263-
fn gen_ascii_str(&mut self, len: uint) -> ~str {
263+
fn gen_ascii_str(&mut self, len: uint) -> StrBuf {
264264
static GEN_ASCII_STR_CHARSET: &'static [u8] = bytes!("ABCDEFGHIJKLMNOPQRSTUVWXYZ\
265265
abcdefghijklmnopqrstuvwxyz\
266266
0123456789");
267267
let mut s = StrBuf::with_capacity(len);
268268
for _ in range(0, len) {
269269
s.push_char(self.choose(GEN_ASCII_STR_CHARSET) as char)
270270
}
271-
s.into_owned()
271+
s
272272
}
273273

274274
/// Choose an item randomly, failing if `values` is empty.

trunk/src/libregex/test/bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ fn gen_text(n: uint) -> StrBuf {
159159
*b = '\n' as u8
160160
}
161161
}
162-
str::from_utf8(bytes).unwrap().to_strbuf()
162+
str::from_utf8(bytes.as_slice()).unwrap().to_strbuf()
163163
}
164164

165165
throughput!(easy0_32, easy0(), 32)

trunk/src/libstd/os.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,9 +1511,9 @@ mod tests {
15111511

15121512
fn make_rand_name() -> ~str {
15131513
let mut rng = rand::task_rng();
1514-
let n = "TEST".to_owned() + rng.gen_ascii_str(10u);
1515-
assert!(getenv(n).is_none());
1516-
n
1514+
let n = format_strbuf!("TEST{}", rng.gen_ascii_str(10u).as_slice());
1515+
assert!(getenv(n.as_slice()).is_none());
1516+
n.into_owned()
15171517
}
15181518

15191519
#[test]

0 commit comments

Comments
 (0)