From 83814fd8ab30e2744d2fb17bdcf5b59840673863 Mon Sep 17 00:00:00 2001 From: Clar Charr Date: Fri, 10 Mar 2017 00:23:54 -0500 Subject: OsString::shrink_to_fit. --- src/libstd/ffi/os_str.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libstd/ffi') diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index 7b8bf42e0a7..41bdd9c51d4 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -205,6 +205,12 @@ 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")] pub fn into_boxed_os_str(self) -> Box { -- cgit 1.4.1-3-g733a5