Skip to content

Commit 30a2766

Browse files
committed
---
yaml --- r: 33371 b: refs/heads/snap-stage3 c: d9f1426 h: refs/heads/master i: 33369: 21410cb 33367: 7a1d0d1 v: v3
1 parent 0186ae8 commit 30a2766

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: cf8bded7aae0673f9275de7948508da3c2b58650
4+
refs/heads/snap-stage3: d9f1426e69410f0eda9b4c1b2e87042a8bbda41d
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libcore/str.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ pub pure fn connect(v: &[~str], sep: &str) -> ~str {
207207
pub fn repeat(ss: &str, nn: uint) -> ~str {
208208
let mut acc = ~"";
209209
for nn.times { acc += ss; }
210-
return acc;
210+
move acc
211211
}
212212

213213
/*
@@ -593,23 +593,23 @@ pub fn split_within(ss: &str, lim: uint) -> ~[~str] {
593593
let mut row : ~str = ~"";
594594

595595
for words.each |wptr| {
596-
let word = *wptr;
596+
let word = copy *wptr;
597597

598598
// if adding this word to the row would go over the limit,
599599
// then start a new row
600-
if str::len(row) + str::len(word) + 1 > lim {
601-
rows += [row]; // save previous row
602-
row = word; // start a new one
600+
if row.len() + word.len() + 1 > lim {
601+
rows.push(copy row); // save previous row
602+
row = move word; // start a new one
603603
} else {
604-
if str::len(row) > 0 { row += ~" " } // separate words
604+
if row.len() > 0 { row += ~" " } // separate words
605605
row += word; // append to this row
606606
}
607607
}
608608
609609
// save the last row
610-
if row != ~"" { rows += [row]; }
610+
if row != ~"" { rows.push(move row); }
611611

612-
return rows;
612+
move rows
613613
}
614614

615615

0 commit comments

Comments
 (0)