提交 7d864294 编写于 作者: P Patrick Walton

libcore: Add an implementation of to_str for &str.

It duplicates the string.
上级 09df8f1a
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册