about summary refs log tree commit diff
path: root/src/libstd/sys_common
diff options
context:
space:
mode:
authorClar Charr <clar@charr.xyz>2017-03-10 00:23:54 -0500
committerClar Charr <clar@charr.xyz>2017-03-10 12:15:30 -0500
commit83814fd8ab30e2744d2fb17bdcf5b59840673863 (patch)
tree12a23eb2f82f8b2432d1b1942d6fc1b47be16e37 /src/libstd/sys_common
parentec87925325c005922977ebf9b10dc9e98d8a6d40 (diff)
downloadrust-83814fd8ab30e2744d2fb17bdcf5b59840673863.tar.gz
rust-83814fd8ab30e2744d2fb17bdcf5b59840673863.zip
OsString::shrink_to_fit.
Diffstat (limited to 'src/libstd/sys_common')
-rw-r--r--src/libstd/sys_common/wtf8.rs5
1 files changed, 5 insertions, 0 deletions
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 {