Add IntoMaybeOwned impl for StrBuf to ease conversion to MaybeOwned.

This commit is contained in:
Felix S. Klock II 2014-05-08 19:11:43 +02:00 committed by Alex Crichton
parent 39b271f4a3
commit 7f88cfde18

View File

@ -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) }