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/sys_common/wtf8.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/libstd/sys_common') diff --git a/src/libstd/sys_common/wtf8.rs b/src/libstd/sys_common/wtf8.rs index 1d61181a4ee..b486d4ffda3 100644 --- a/src/libstd/sys_common/wtf8.rs +++ b/src/libstd/sys_common/wtf8.rs @@ -236,6 +236,11 @@ impl Wtf8Buf { self.bytes.reserve_exact(additional) } + #[inline] + pub fn shrink_to_fit(&mut self) { + self.bytes.shrink_to_fit() + } + /// Returns the number of bytes that this string buffer can hold without reallocating. #[inline] pub fn capacity(&self) -> usize { -- cgit 1.4.1-3-g733a5