1
Fork 0

Make to_str pure and fix const parameters for str-mutating functions

Two separate changes that got intertwined (sorry):

Make to_str pure. Closes #3691

In str, change functions like push_char to take an &mut str instead of
an &str. Closes #3710
This commit is contained in:
Tim Chevalier 2012-10-11 14:12:50 -07:00
parent 41bce91cb8
commit 5a8ba073bc
14 changed files with 87 additions and 75 deletions

View file

@ -61,7 +61,7 @@ pub pure fn Path(s: &str) -> Path {
}
impl PosixPath : ToStr {
fn to_str() -> ~str {
pure fn to_str() -> ~str {
let mut s = ~"";
if self.is_absolute {
s += "/";
@ -236,7 +236,7 @@ impl PosixPath : GenericPath {
impl WindowsPath : ToStr {
fn to_str() -> ~str {
pure fn to_str() -> ~str {
let mut s = ~"";
match self.host {
Some(ref h) => { s += "\\\\"; s += *h; }