diff options
| author | Clar Charr <clar@charr.xyz> | 2017-03-10 00:23:54 -0500 |
|---|---|---|
| committer | Clar Charr <clar@charr.xyz> | 2017-03-10 12:15:30 -0500 |
| commit | 83814fd8ab30e2744d2fb17bdcf5b59840673863 (patch) | |
| tree | 12a23eb2f82f8b2432d1b1942d6fc1b47be16e37 /src/libstd/ffi | |
| parent | ec87925325c005922977ebf9b10dc9e98d8a6d40 (diff) | |
| download | rust-83814fd8ab30e2744d2fb17bdcf5b59840673863.tar.gz rust-83814fd8ab30e2744d2fb17bdcf5b59840673863.zip | |
OsString::shrink_to_fit.
Diffstat (limited to 'src/libstd/ffi')
| -rw-r--r-- | src/libstd/ffi/os_str.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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<OsStr> { |
