std: Implement try_reserve and try_reserve_exact on PathBuf
Signed-off-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
parent
b5da80871d
commit
edae82e5e4
@ -72,6 +72,7 @@
|
||||
|
||||
use crate::borrow::{Borrow, Cow};
|
||||
use crate::cmp;
|
||||
use crate::collections::TryReserveError;
|
||||
use crate::error::Error;
|
||||
use crate::fmt;
|
||||
use crate::fs;
|
||||
@ -1512,6 +1513,15 @@ pub fn reserve(&mut self, additional: usize) {
|
||||
self.inner.reserve(additional)
|
||||
}
|
||||
|
||||
/// Invokes [`try_reserve`] on the underlying instance of [`OsString`].
|
||||
///
|
||||
/// [`try_reserve`]: OsString::try_reserve
|
||||
#[unstable(feature = "try_reserve_2", issue = "91789")]
|
||||
#[inline]
|
||||
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
|
||||
self.inner.try_reserve(additional)
|
||||
}
|
||||
|
||||
/// Invokes [`reserve_exact`] on the underlying instance of [`OsString`].
|
||||
///
|
||||
/// [`reserve_exact`]: OsString::reserve_exact
|
||||
@ -1521,6 +1531,15 @@ pub fn reserve_exact(&mut self, additional: usize) {
|
||||
self.inner.reserve_exact(additional)
|
||||
}
|
||||
|
||||
/// Invokes [`try_reserve_exact`] on the underlying instance of [`OsString`].
|
||||
///
|
||||
/// [`try_reserve_exact`]: OsString::try_reserve_exact
|
||||
#[unstable(feature = "try_reserve_2", issue = "91789")]
|
||||
#[inline]
|
||||
pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> {
|
||||
self.inner.try_reserve_exact(additional)
|
||||
}
|
||||
|
||||
/// Invokes [`shrink_to_fit`] on the underlying instance of [`OsString`].
|
||||
///
|
||||
/// [`shrink_to_fit`]: OsString::shrink_to_fit
|
||||
|
Loading…
Reference in New Issue
Block a user