From f6bc6689c62c60c7240d5c0b72bc53834fcfacef Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+kristof-mattei@users.noreply.github.com> Date: Sat, 27 Dec 2025 14:45:26 -0700 Subject: [PATCH] fix: add try_reserve --- src/lib.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8477b8a..ec780d1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -87,8 +87,12 @@ impl NonEmptyString { /// See [`String::reserve_exact`] pub fn reserve_exact(&mut self, additional: usize); - // For some reason we cannot delegate the following: - // pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> + /// Is forwarded to the inner String. + /// See [`String::try_reserve`] + pub fn try_reserve( + &mut self, + additional: usize + ) -> Result<(), std::collections::TryReserveError>; /// Is forwarded to the inner String. /// See [`String::try_reserve_exact`]