@@ -72,6 +72,7 @@ mod tests;
7272
7373use crate :: borrow:: { Borrow , Cow } ;
7474use crate :: cmp;
75+ use crate :: collections:: TryReserveError ;
7576use crate :: error:: Error ;
7677use crate :: fmt;
7778use crate :: fs;
@@ -1512,6 +1513,15 @@ impl PathBuf {
15121513 self . inner . reserve ( additional)
15131514 }
15141515
1516+ /// Invokes [`try_reserve`] on the underlying instance of [`OsString`].
1517+ ///
1518+ /// [`try_reserve`]: OsString::try_reserve
1519+ #[ unstable( feature = "try_reserve_2" , issue = "91789" ) ]
1520+ #[ inline]
1521+ pub fn try_reserve ( & mut self , additional : usize ) -> Result < ( ) , TryReserveError > {
1522+ self . inner . try_reserve ( additional)
1523+ }
1524+
15151525 /// Invokes [`reserve_exact`] on the underlying instance of [`OsString`].
15161526 ///
15171527 /// [`reserve_exact`]: OsString::reserve_exact
@@ -1521,6 +1531,15 @@ impl PathBuf {
15211531 self . inner . reserve_exact ( additional)
15221532 }
15231533
1534+ /// Invokes [`try_reserve_exact`] on the underlying instance of [`OsString`].
1535+ ///
1536+ /// [`try_reserve_exact`]: OsString::try_reserve_exact
1537+ #[ unstable( feature = "try_reserve_2" , issue = "91789" ) ]
1538+ #[ inline]
1539+ pub fn try_reserve_exact ( & mut self , additional : usize ) -> Result < ( ) , TryReserveError > {
1540+ self . inner . try_reserve_exact ( additional)
1541+ }
1542+
15241543 /// Invokes [`shrink_to_fit`] on the underlying instance of [`OsString`].
15251544 ///
15261545 /// [`shrink_to_fit`]: OsString::shrink_to_fit
0 commit comments