From bec64090a70a25c75b1856cf35dcdcf20993f8f8 Mon Sep 17 00:00:00 2001 From: Ulrik Sverdrup Date: Thu, 13 Aug 2015 14:02:00 +0200 Subject: Rename String::into_boxed_slice -> into_boxed_str MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the name that was decided in rust-lang/rfcs#1152, and it's better if we say “boxed str” for `Box`. The old name `String::into_boxed_slice` is deprecated. --- src/libcollections/string.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/libcollections/string.rs') diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 0b441b42cdc..7f329056b0e 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -749,10 +749,20 @@ impl String { /// Note that this will drop any excess capacity. #[unstable(feature = "box_str", reason = "recently added, matches RFC")] - pub fn into_boxed_slice(self) -> Box { + pub fn into_boxed_str(self) -> Box { let slice = self.vec.into_boxed_slice(); unsafe { mem::transmute::, Box>(slice) } } + + /// Converts the string into `Box`. + /// + /// Note that this will drop any excess capacity. + #[unstable(feature = "box_str", + reason = "recently added, matches RFC")] + #[deprecated(since = "1.4.0", reason = "renamed to `into_boxed_str`")] + pub fn into_boxed_slice(self) -> Box { + self.into_boxed_str() + } } impl FromUtf8Error { -- cgit 1.4.1-3-g733a5