From: bors Date: Wed, 15 Mar 2017 04:24:10 +0000 (+0000) Subject: Auto merge of #40009 - clarcharr:box_to_buf, r=alexcrichton X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=71d7b29475225ae799f4906f3b50e06a7d323890;p=rust.git Auto merge of #40009 - clarcharr:box_to_buf, r=alexcrichton Leftovers from #39594; From impls These are a few more impls that follow the same reasoning as those from #39594. What's included: * `From> for String` * `From> for Vec` * `From> for CString` * `From> for OsString` * `From> for PathBuf` * `Into> for String` * `Into> for Vec` * `Into> for CString` * `Into> for OsString` * `Into> for PathBuf` * `>::into_c_string` * `>::into_os_string` * `>::into_path_buf` * Tracking issue for latter three methods + three from previous PR. Currently, the opposite direction isn't doable with `From` (only `Into`) because of the separation between `liballoc` and `libcollections`. I'm holding off on those for a later PR. --- 71d7b29475225ae799f4906f3b50e06a7d323890 diff --cc src/libstd/ffi/os_str.rs index 41bdd9c51d4,c9c207d8b8e..2765fd83ed5 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@@ -205,14 -205,8 +205,14 @@@ impl OsString self.inner.reserve_exact(additional) } + /// Shrinks the capacity of the `OsString` to match its length. + #[unstable(feature = "osstring_shrink_to_fit", issue = "40421")] + pub fn shrink_to_fit(&mut self) { + self.inner.shrink_to_fit() + } + /// Converts this `OsString` into a boxed `OsStr`. - #[unstable(feature = "into_boxed_os_str", issue = "0")] + #[unstable(feature = "into_boxed_os_str", issue = "40380")] pub fn into_boxed_os_str(self) -> Box { unsafe { mem::transmute(self.inner.into_box()) } }