diff --git a/src/write.rs b/src/write.rs index 47ac29b..85817ef 100644 --- a/src/write.rs +++ b/src/write.rs @@ -827,6 +827,15 @@ impl BitRecorder { } } + /// Creates new recorder sized for the given number of writes + #[inline] + pub fn with_capacity(writes: usize) -> Self { + BitRecorder { + counter: BitCounter::new(), + records: Vec::with_capacity(writes), + } + } + /// Creates new recorder with the given endiannness #[inline] pub fn endian(_endian: E) -> Self {