diff options
| author | Brian Anderson <andersrb@gmail.com> | 2013-02-04 10:15:02 -0800 |
|---|---|---|
| committer | Brian Anderson <andersrb@gmail.com> | 2013-02-04 10:15:02 -0800 |
| commit | 27e1ac5bb93626da70135e167a6596d854e7e679 (patch) | |
| tree | e2a6b58b69d484cae48f9b0a4f2132fbe7f20979 /src/libstd | |
| parent | 750f246ad5f3a2a1a4df1a40d547c112074bb447 (diff) | |
| parent | 9adfa59d8e9432eef84297b6ed5d8f2967b9b8f9 (diff) | |
Merge pull request #4684 from erickt/incoming
core: convert ToStr::to_str to take explicit &self
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/bigint.rs | 4 | ||||
| -rw-r--r-- | src/libstd/bitv.rs | 2 | ||||
| -rw-r--r-- | src/libstd/json.rs | 4 | ||||
| -rw-r--r-- | src/libstd/net_url.rs | 4 | ||||
| -rw-r--r-- | src/libstd/oldmap.rs | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/src/libstd/bigint.rs b/src/libstd/bigint.rs index 64126ea918f..092a0d18a0f 100644 --- a/src/libstd/bigint.rs +++ b/src/libstd/bigint.rs @@ -88,7 +88,7 @@ impl BigUint : Ord { } impl BigUint : ToStr { - pure fn to_str() -> ~str { self.to_str_radix(10) } + pure fn to_str(&self) -> ~str { self.to_str_radix(10) } } impl BigUint : from_str::FromStr { @@ -605,7 +605,7 @@ impl BigInt : Ord { } impl BigInt : ToStr { - pure fn to_str() -> ~str { self.to_str_radix(10) } + pure fn to_str(&self) -> ~str { self.to_str_radix(10) } } impl BigInt : from_str::FromStr { diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs index 0ad9d0af2ac..69becd5b9ce 100644 --- a/src/libstd/bitv.rs +++ b/src/libstd/bitv.rs @@ -474,7 +474,7 @@ impl Bitv { * The resulting string has the same length as `self`, and each * character is either '0' or '1'. */ - fn to_str() -> ~str { + fn to_str(&self) -> ~str { let mut rs = ~""; for self.each() |i| { if i { rs += ~"1"; } else { rs += ~"0"; } }; rs diff --git a/src/libstd/json.rs b/src/libstd/json.rs index b9e3b29b152..4b34f318e91 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -1172,11 +1172,11 @@ impl <A: ToJson> Option<A>: ToJson { } impl Json: to_str::ToStr { - pure fn to_str() -> ~str { to_str(&self) } + pure fn to_str(&self) -> ~str { to_str(self) } } impl Error: to_str::ToStr { - pure fn to_str() -> ~str { + pure fn to_str(&self) -> ~str { fmt!("%u:%u: %s", self.line, self.col, *self.msg) } } diff --git a/src/libstd/net_url.rs b/src/libstd/net_url.rs index 89b19fccc1c..b32c97c6998 100644 --- a/src/libstd/net_url.rs +++ b/src/libstd/net_url.rs @@ -718,8 +718,8 @@ pub pure fn to_str(url: &Url) -> ~str { } impl Url: to_str::ToStr { - pub pure fn to_str() -> ~str { - to_str(&self) + pub pure fn to_str(&self) -> ~str { + to_str(self) } } diff --git a/src/libstd/oldmap.rs b/src/libstd/oldmap.rs index d8fecda73a7..e32043a7225 100644 --- a/src/libstd/oldmap.rs +++ b/src/libstd/oldmap.rs @@ -353,7 +353,7 @@ pub mod chained { } impl<K:Eq IterBytes Hash Copy ToStr, V: ToStr Copy> T<K, V>: ToStr { - pure fn to_str() -> ~str { + pure fn to_str(&self) -> ~str { unsafe { // Meh -- this should be safe do io::with_str_writer |wr| { self.to_writer(wr) } |
