@@ -72,6 +72,7 @@ mod tests;
72
72
73
73
use crate :: borrow:: { Borrow , Cow } ;
74
74
use crate :: cmp;
75
+ use crate :: collections:: TryReserveError ;
75
76
use crate :: error:: Error ;
76
77
use crate :: fmt;
77
78
use crate :: fs;
@@ -1512,6 +1513,15 @@ impl PathBuf {
1512
1513
self . inner . reserve ( additional)
1513
1514
}
1514
1515
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
+
1515
1525
/// Invokes [`reserve_exact`] on the underlying instance of [`OsString`].
1516
1526
///
1517
1527
/// [`reserve_exact`]: OsString::reserve_exact
@@ -1521,6 +1531,15 @@ impl PathBuf {
1521
1531
self . inner . reserve_exact ( additional)
1522
1532
}
1523
1533
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
+
1524
1543
/// Invokes [`shrink_to_fit`] on the underlying instance of [`OsString`].
1525
1544
///
1526
1545
/// [`shrink_to_fit`]: OsString::shrink_to_fit
0 commit comments