From 52181d2e5ef2e9d4a369d6fb7355a5335a2831b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sun, 7 Sep 2025 16:27:22 +0200 Subject: [PATCH] Enable try_reserve() --- src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8477b8a..0314f15 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -87,8 +87,9 @@ 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`]