From 9d02f6a2cbc3e46241368cc084acffe89ca7659c Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Sun, 6 Apr 2025 17:48:33 -0700 Subject: [PATCH] Rename capacity type parameter --- src/cstring.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cstring.rs b/src/cstring.rs index 4cfe252f..317ed69a 100644 --- a/src/cstring.rs +++ b/src/cstring.rs @@ -20,7 +20,7 @@ fn memchr(needle: u8, haystack: &[u8]) -> Option { haystack.iter().position(|&b| b == needle) } -impl CString { +impl CString { /// Constructs a new, "empty" `CString`. /// /// Stores the first nil byte as the first @@ -213,7 +213,7 @@ impl CString { /// ``` pub fn push_bytes(&mut self, bytes: &[u8]) -> Result<(), CapacityError> { match self.size_if_appended_bytes(bytes) { - Some(resulting_size) if resulting_size > CAP => { + Some(resulting_size) if resulting_size > N => { // Can't store these bytes due to insufficient capacity return Err(CapacityError); }