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:
parent
41bce91cb8
commit
5a8ba073bc
14 changed files with 87 additions and 75 deletions
|
@ -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; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue