Update `ScriptBuf::with_capacity` docs

Document that `ScriptBuf::with_capacity` may overallocate.
This commit is contained in:
Daniel Roberts 2025-05-10 19:17:50 -05:00
parent afde8499ac
commit e492f94289
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ impl ScriptBuf {
Script::from_boxed_bytes(self.into_bytes().into_boxed_slice()) Script::from_boxed_bytes(self.into_bytes().into_boxed_slice())
} }
/// Constructs a new empty script with pre-allocated capacity. /// Constructs a new empty script with at least the specified capacity.
#[inline] #[inline]
pub fn with_capacity(capacity: usize) -> Self { pub fn with_capacity(capacity: usize) -> Self {
ScriptBuf::from_bytes(Vec::with_capacity(capacity)) ScriptBuf::from_bytes(Vec::with_capacity(capacity))