diff options
| author | Xuanwo <github@xuanwo.io> | 2021-12-28 11:40:58 +0800 |
|---|---|---|
| committer | Xuanwo <github@xuanwo.io> | 2021-12-28 11:40:58 +0800 |
| commit | 013fbc61877c8b1ca964274f171bd79952247fc3 (patch) | |
| tree | e62ca280120fac99031e5d8fafa7d6ca8c76e6a3 /library/std/src/sys | |
| parent | c40ac57efb88b308b869be2ec47da59aba3c842c (diff) | |
| download | rust-013fbc61877c8b1ca964274f171bd79952247fc3.tar.gz rust-013fbc61877c8b1ca964274f171bd79952247fc3.zip | |
Fix windows build
Signed-off-by: Xuanwo <github@xuanwo.io>
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/windows/os_str.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/library/std/src/sys/windows/os_str.rs b/library/std/src/sys/windows/os_str.rs index 7e09a4fd561..78e92a3331a 100644 --- a/library/std/src/sys/windows/os_str.rs +++ b/library/std/src/sys/windows/os_str.rs @@ -1,6 +1,7 @@ /// The underlying OsString/OsStr implementation on Windows is a /// wrapper around the "WTF-8" encoding; see the `wtf8` module for more. use crate::borrow::Cow; +use crate::collections::TryReserveError; use crate::fmt; use crate::mem; use crate::rc::Rc; @@ -104,10 +105,18 @@ impl Buf { self.inner.reserve(additional) } + pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { + self.inner.try_reserve(additional) + } + pub fn reserve_exact(&mut self, additional: usize) { self.inner.reserve_exact(additional) } + pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> { + self.inner.try_reserve_exact(additional) + } + pub fn shrink_to_fit(&mut self) { self.inner.shrink_to_fit() } |
