about summary refs log tree commit diff
path: root/src/libstd/str.rs
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2014-05-08 19:11:43 +0200
committerAlex Crichton <alex@alexcrichton.com>2014-05-15 13:50:42 -0700
commit7f88cfde18942fc93c3f5952e51c03171446778c (patch)
treeec63367b053aa27305ca542c0d3d17fb6cbc4b62 /src/libstd/str.rs
parent39b271f4a309b850c947f5c4e61c978a3cfbcd1e (diff)
downloadrust-7f88cfde18942fc93c3f5952e51c03171446778c.tar.gz
rust-7f88cfde18942fc93c3f5952e51c03171446778c.zip
Add `IntoMaybeOwned` impl for `StrBuf` to ease conversion to `MaybeOwned`.
Diffstat (limited to 'src/libstd/str.rs')
-rw-r--r--src/libstd/str.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index fa4cf8e4427..aee5fe9ff96 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -564,6 +564,11 @@ impl<'a> IntoMaybeOwned<'a> for ~str {
     fn into_maybe_owned(self) -> MaybeOwned<'a> { Owned(self) }
 }
 
+impl<'a> IntoMaybeOwned<'a> for StrBuf {
+    #[inline]
+    fn into_maybe_owned(self) -> MaybeOwned<'a> { Owned(self.into_owned()) }
+}
+
 impl<'a> IntoMaybeOwned<'a> for &'a str {
     #[inline]
     fn into_maybe_owned(self) -> MaybeOwned<'a> { Slice(self) }