Skip to content

Commit 7f88cfd

Browse files
pnkfelixalexcrichton
authored andcommitted
Add IntoMaybeOwned impl for StrBuf to ease conversion to MaybeOwned.
1 parent 39b271f commit 7f88cfd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libstd/str.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,11 @@ impl<'a> IntoMaybeOwned<'a> for ~str {
564564
fn into_maybe_owned(self) -> MaybeOwned<'a> { Owned(self) }
565565
}
566566

567+
impl<'a> IntoMaybeOwned<'a> for StrBuf {
568+
#[inline]
569+
fn into_maybe_owned(self) -> MaybeOwned<'a> { Owned(self.into_owned()) }
570+
}
571+
567572
impl<'a> IntoMaybeOwned<'a> for &'a str {
568573
#[inline]
569574
fn into_maybe_owned(self) -> MaybeOwned<'a> { Slice(self) }

0 commit comments

Comments
 (0)