diff options
| author | kennytm <kennytm@gmail.com> | 2018-03-28 17:55:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-28 17:55:09 +0200 |
| commit | 010fb40b4454a2dc278cbb8a636590d081f10295 (patch) | |
| tree | 264e28d5735f108f5c77186d6675ddd470a0d2a1 /src/libstd/sys_common | |
| parent | 0214304b5aa74fd6beaefb2474d6ba90ea423a43 (diff) | |
| parent | 04f6692aaf78809c041ba6145bde2dcbeec9725e (diff) | |
| download | rust-010fb40b4454a2dc278cbb8a636590d081f10295.tar.gz rust-010fb40b4454a2dc278cbb8a636590d081f10295.zip | |
Rollup merge of #49400 - Diggsey:shrink-to, r=joshtriplett
Implement `shrink_to` method on collections Fixes #49385
Diffstat (limited to 'src/libstd/sys_common')
| -rw-r--r-- | src/libstd/sys_common/wtf8.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstd/sys_common/wtf8.rs b/src/libstd/sys_common/wtf8.rs index 78b2bb5fe6e..dda4e1bab3b 100644 --- a/src/libstd/sys_common/wtf8.rs +++ b/src/libstd/sys_common/wtf8.rs @@ -253,6 +253,11 @@ impl Wtf8Buf { self.bytes.shrink_to_fit() } + #[inline] + pub fn shrink_to(&mut self, min_capacity: usize) { + self.bytes.shrink_to(min_capacity) + } + /// Returns the number of bytes that this string buffer can hold without reallocating. #[inline] pub fn capacity(&self) -> usize { |
