From 7a6df9c90ff1042c07bf785b724884fb84df195f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Wed, 12 Sep 2012 21:15:27 +0200 Subject: [PATCH] core: Implement ToStr for @str --- src/libcore/to_str.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libcore/to_str.rs b/src/libcore/to_str.rs index 21a29a6b07d3..b0caf894dfc7 100644 --- a/src/libcore/to_str.rs +++ b/src/libcore/to_str.rs @@ -49,6 +49,9 @@ impl ~str: ToStr { impl &str: ToStr { fn to_str() -> ~str { str::from_slice(self) } } +impl @str: ToStr { + fn to_str() -> ~str { str::from_slice(self) } +} impl (A, B): ToStr { fn to_str() -> ~str { @@ -96,6 +99,7 @@ mod tests { assert false.to_str() == ~"false"; assert ().to_str() == ~"()"; assert (~"hi").to_str() == ~"hi"; + assert (@"hi").to_str() == ~"hi"; } #[test]