diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2014-05-08 19:11:43 +0200 | 
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-15 13:50:42 -0700 | 
| commit | 7f88cfde18942fc93c3f5952e51c03171446778c (patch) | |
| tree | ec63367b053aa27305ca542c0d3d17fb6cbc4b62 /src/libstd/str.rs | |
| parent | 39b271f4a309b850c947f5c4e61c978a3cfbcd1e (diff) | |
| download | rust-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.rs | 5 | 
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) } | 
