libcore: Add an implementation of to_str for &str.
It duplicates the string.
This commit is contained in:
parent
09df8f1abf
commit
7d86429415
@ -46,6 +46,9 @@ fn to_str() -> ~str { ~"()" }
|
||||
impl ~str: ToStr {
|
||||
fn to_str() -> ~str { self }
|
||||
}
|
||||
impl &str: ToStr {
|
||||
fn to_str() -> ~str { str::from_slice(self) }
|
||||
}
|
||||
|
||||
impl<A: ToStr copy, B: ToStr copy> (A, B): ToStr {
|
||||
fn to_str() -> ~str {
|
||||
|
Loading…
Reference in New Issue
Block a user