diff --git a/rs/compression/src/compression.rs b/rs/compression/src/compression.rs index 232374a..652930a 100644 --- a/rs/compression/src/compression.rs +++ b/rs/compression/src/compression.rs @@ -6,7 +6,7 @@ use memmap2::Mmap; pub trait IntSeqEncoder { /// Creates an encoder - fn new_encoder(universe: Option, num_elem: usize) -> Self + fn new_encoder(universe: usize, num_elem: usize) -> Self where Self: Sized; diff --git a/rs/compression/src/noc/noc.rs b/rs/compression/src/noc/noc.rs index e364c49..3bb012d 100644 --- a/rs/compression/src/noc/noc.rs +++ b/rs/compression/src/noc/noc.rs @@ -23,7 +23,7 @@ impl PlainEncoder { } impl IntSeqEncoder for PlainEncoder { - fn new_encoder(_universe: Option, num_elem: usize) -> Self { + fn new_encoder(_universe: usize, num_elem: usize) -> Self { Self::new(num_elem) } diff --git a/rs/index/src/ivf/writer.rs b/rs/index/src/ivf/writer.rs index 968f7ac..bb3eba8 100644 --- a/rs/index/src/ivf/writer.rs +++ b/rs/index/src/ivf/writer.rs @@ -188,7 +188,10 @@ impl IvfWriter { .get(i as u32)? .iter() .collect::>(); - let mut encoder = C::new_encoder(/*universe*/ None, posting_list.len()); + let mut encoder = C::new_encoder( + *posting_list.last().unwrap_or(&0) as usize, + posting_list.len(), + ); // Encode to get the length of the encoded data encoder.encode(&posting_list)?; // Write the length of the encoded posting list