Skip to content

Commit d48396c

Browse files
committed
libcore: De-mode str
1 parent 49af969 commit d48396c

File tree

19 files changed

+182
-159
lines changed

19 files changed

+182
-159
lines changed

src/compiletest/procsrv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn readclose(fd: c_int) -> ~str {
104104
let mut buf = ~"";
105105
while !reader.eof() {
106106
let bytes = reader.read_bytes(4096u);
107-
str::push_str(buf, str::from_bytes(bytes));
107+
str::push_str(&mut buf, str::from_bytes(bytes));
108108
}
109109
os::fclose(file);
110110
return buf;

src/libcore/char.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ fn escape_unicode(c: char) -> ~str {
141141
else { ('U', 8u) });
142142
assert str::len(s) <= pad;
143143
let mut out = ~"\\";
144-
str::push_str(out, str::from_char(c));
145-
for uint::range(str::len(s), pad) |_i| { str::push_str(out, ~"0"); }
146-
str::push_str(out, s);
144+
str::push_str(&mut out, str::from_char(c));
145+
for uint::range(str::len(s), pad) |_i| { str::push_str(&mut out, ~"0"); }
146+
str::push_str(&mut out, s);
147147
move out
148148
}
149149

src/libcore/extfmt.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,9 @@ mod rt {
293293
let mut s : ~str = int_to_str_prec(i, radix, prec);
294294
if 0 <= i {
295295
if have_flag(cv.flags, flag_sign_always) {
296-
unsafe { str::unshift_char(s, '+') };
296+
unsafe { str::unshift_char(&mut s, '+') };
297297
} else if have_flag(cv.flags, flag_space_for_sign) {
298-
unsafe { str::unshift_char(s, ' ') };
298+
unsafe { str::unshift_char(&mut s, ' ') };
299299
}
300300
}
301301
return unsafe { pad(cv, s, PadSigned) };
@@ -463,13 +463,13 @@ mod rt {
463463
// instead.
464464

465465
if signed && zero_padding && str::len(s) > 0u {
466-
let head = str::shift_char(s);
466+
let head = str::shift_char(&mut s);
467467
if head == '+' || head == '-' || head == ' ' {
468468
let headstr = str::from_chars(vec::from_elem(1u, head));
469469
return headstr + padstr + s;
470470
}
471471
else {
472-
str::unshift_char(s, head);
472+
str::unshift_char(&mut s, head);
473473
}
474474
}
475475
return padstr + s;
@@ -500,9 +500,9 @@ mod rt2 {
500500
let mut s : ~str = int_to_str_prec(i, radix, prec);
501501
if 0 <= i {
502502
if have_flag(cv.flags, flag_sign_always) {
503-
unsafe { str::unshift_char(s, '+') };
503+
unsafe { str::unshift_char(&mut s, '+') };
504504
} else if have_flag(cv.flags, flag_space_for_sign) {
505-
unsafe { str::unshift_char(s, ' ') };
505+
unsafe { str::unshift_char(&mut s, ' ') };
506506
}
507507
}
508508
return unsafe { pad(cv, s, PadSigned) };
@@ -670,13 +670,13 @@ mod rt2 {
670670
// instead.
671671

672672
if signed && zero_padding && str::len(s) > 0u {
673-
let head = str::shift_char(s);
673+
let head = str::shift_char(&mut s);
674674
if head == '+' || head == '-' || head == ' ' {
675675
let headstr = str::from_chars(vec::from_elem(1u, head));
676676
return headstr + padstr + s;
677677
}
678678
else {
679-
str::unshift_char(s, head);
679+
str::unshift_char(&mut s, head);
680680
}
681681
}
682682
return padstr + s;

0 commit comments

Comments
 (0)