File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
branches/try2/src/libcore Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5
5
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: cf8bded7aae0673f9275de7948508da3c2b58650
8
+ refs/heads/try2: d9f1426e69410f0eda9b4c1b2e87042a8bbda41d
9
9
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10
10
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ pub pure fn connect(v: &[~str], sep: &str) -> ~str {
207
207
pub fn repeat( ss : & str , nn : uint ) -> ~str {
208
208
let mut acc = ~"";
209
209
for nn. times { acc += ss; }
210
- return acc;
210
+ move acc
211
211
}
212
212
213
213
/*
@@ -593,23 +593,23 @@ pub fn split_within(ss: &str, lim: uint) -> ~[~str] {
593
593
let mut row : ~str = ~"";
594
594
595
595
for words. each |wptr| {
596
- let word = * wptr;
596
+ let word = copy * wptr;
597
597
598
598
// if adding this word to the row would go over the limit,
599
599
// 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
603
603
} else {
604
- if str :: len ( row ) > 0 { row += ~" " } // separate words
604
+ if row . len ( ) > 0 { row += ~" " } // separate words
605
605
row += word; // append to this row
606
606
}
607
607
}
608
608
609
609
// save the last row
610
- if row != ~" " { rows += [ row] ; }
610
+ if row != ~" " { rows. push ( move row) ; }
611
611
612
- return rows;
612
+ move rows
613
613
}
614
614
615
615
You can’t perform that action at this time.
0 commit comments