diff --git a/CHANGELOG.md b/CHANGELOG.md index 101dd5b..2115ca2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Added `from_bit` constructor on `BitVectorBuilder` for repeating a single bit. - `DacsByte` now stores level data as zero-copy `View<[u8]>` values. - Added `get_bits` methods to `BitVectorData` and `BitVector`. +- Removed deprecated `size_in_bytes` helpers. - Added `scripts/devtest.sh` and `scripts/preflight.sh` for testing and verification workflows. - Simplified CI workflow to run `scripts/preflight.sh` on pull requests. diff --git a/src/bit_vector/mod.rs b/src/bit_vector/mod.rs index b105b71..3e27ece 100644 --- a/src/bit_vector/mod.rs +++ b/src/bit_vector/mod.rs @@ -311,11 +311,6 @@ impl BitVectorData { Some(bits) } - /// Returns the number of bytes required for the old copy-based serialization. - pub fn size_in_bytes(&self) -> usize { - std::mem::size_of::() * (self.words.len() + 2) - } - /// Serializes the data into a [`Bytes`] buffer. pub fn to_bytes(&self) -> (usize, Bytes) { (self.len, self.words.clone().bytes()) diff --git a/src/bit_vector/rank9sel/inner.rs b/src/bit_vector/rank9sel/inner.rs index 11d7e15..42b20cc 100644 --- a/src/bit_vector/rank9sel/inner.rs +++ b/src/bit_vector/rank9sel/inner.rs @@ -516,23 +516,6 @@ impl Rank9SelIndex { } Bytes::from_source(store) } - - /// Returns the number of bytes required for the old copy-based serialization. - pub fn size_in_bytes(&self) -> usize { - let mut mem = std::mem::size_of::() * 2; - mem += std::mem::size_of::() * self.block_rank_pairs.len(); - mem += std::mem::size_of::(); - if let Some(hints) = &self.select1_hints { - mem += std::mem::size_of::(); - mem += std::mem::size_of::() * hints.len(); - } - mem += std::mem::size_of::(); - if let Some(hints) = &self.select0_hints { - mem += std::mem::size_of::(); - mem += std::mem::size_of::() * hints.len(); - } - mem - } } impl crate::bit_vector::BitVectorIndex diff --git a/src/char_sequences/wavelet_matrix.rs b/src/char_sequences/wavelet_matrix.rs index d5b144e..f6c381f 100644 --- a/src/char_sequences/wavelet_matrix.rs +++ b/src/char_sequences/wavelet_matrix.rs @@ -7,7 +7,7 @@ use std::ops::Range; use anyhow::{anyhow, Result}; use crate::bit_vector::{ - Access, BitVector, BitVectorBuilder, BitVectorIndex, NumBits, Rank, Rank9SelIndex, Select, + Access, BitVector, BitVectorBuilder, BitVectorIndex, NumBits, Rank, Select, }; use crate::int_vectors::{CompactVector, CompactVectorBuilder}; use crate::utils; @@ -599,19 +599,6 @@ where } } -impl WaveletMatrix { - /// Returns the number of bytes required for the old copy-based serialization. - pub fn size_in_bytes(&self) -> usize { - std::mem::size_of::() - + self - .layers - .iter() - .map(|l| l.data.size_in_bytes() + l.index.size_in_bytes()) - .sum::() - + std::mem::size_of::() - } -} - #[cfg(test)] mod test { use super::*; diff --git a/src/int_vectors/compact_vector.rs b/src/int_vectors/compact_vector.rs index 47b805f..5abd288 100644 --- a/src/int_vectors/compact_vector.rs +++ b/src/int_vectors/compact_vector.rs @@ -510,13 +510,6 @@ impl std::fmt::Debug for CompactVector { } } -impl CompactVector { - /// Returns the number of bytes required for the old copy-based serialization. - pub fn size_in_bytes(&self) -> usize { - self.chunks.data.size_in_bytes() + std::mem::size_of::() * 2 - } -} - #[cfg(test)] mod tests { use super::*; diff --git a/src/int_vectors/dacs_byte.rs b/src/int_vectors/dacs_byte.rs index b5f3a73..3df597c 100644 --- a/src/int_vectors/dacs_byte.rs +++ b/src/int_vectors/dacs_byte.rs @@ -293,24 +293,6 @@ impl Iterator for Iter<'_> { } } -impl DacsByte { - /// Returns the number of bytes required for the old copy-based serialization. - pub fn size_in_bytes(&self) -> usize { - std::mem::size_of::() - + self - .data - .iter() - .map(|v| std::mem::size_of::() + v.len()) - .sum::() - + std::mem::size_of::() - + self - .flags - .iter() - .map(|f| f.data.size_in_bytes() + f.index.size_in_bytes()) - .sum::() - } -} - #[cfg(test)] mod tests { use super::*;