Fix windows build

Signed-off-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
Xuanwo 2021-12-28 11:40:58 +08:00
parent c40ac57efb
commit 013fbc6187
No known key found for this signature in database
GPG Key ID: C423B4FA6B48E945

View File

@ -1,6 +1,7 @@
/// The underlying OsString/OsStr implementation on Windows is a /// The underlying OsString/OsStr implementation on Windows is a
/// wrapper around the "WTF-8" encoding; see the `wtf8` module for more. /// wrapper around the "WTF-8" encoding; see the `wtf8` module for more.
use crate::borrow::Cow; use crate::borrow::Cow;
use crate::collections::TryReserveError;
use crate::fmt; use crate::fmt;
use crate::mem; use crate::mem;
use crate::rc::Rc; use crate::rc::Rc;
@ -104,10 +105,18 @@ impl Buf {
self.inner.reserve(additional) 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) { pub fn reserve_exact(&mut self, additional: usize) {
self.inner.reserve_exact(additional) 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) { pub fn shrink_to_fit(&mut self) {
self.inner.shrink_to_fit() self.inner.shrink_to_fit()
} }