forge
Explore
Log in

Don't you dare go Hollow

Revert "U13: remove BitWriter::with_capacity; no caller anywhere"

Browse files at this commit

a8775a4eee8c26a7f18423c798160c7a5a0a2752Ahmet Kaan GümüşParent: 4d05634
This reverts commit 9557dcb6156fba9d4f91762e59d90991b895c29a.
crates/ec-core/src/bitio.rsmodified+8 -0
@@ -151,6 +151,14 @@ impl BitWriter {
151 BitWriter::default()151 BitWriter::default()
152 }152 }
153 153
154+ /// An empty writer with room for `bytes`.
155+ pub fn with_capacity(bytes: usize) -> BitWriter {
156+ BitWriter {
157+ buf: Vec::with_capacity(bytes),
158+ used: 0,
159+ }
160+ }
161+
154 /// Bits written so far.162 /// Bits written so far.
155 pub fn bit_len(&self) -> u64 {163 pub fn bit_len(&self) -> u64 {
156 if self.used == 0 {164 if self.used == 0 {