Skip to content

Commit

Permalink
Fix size hint on the vector iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
pkolaczk committed Aug 12, 2024
1 parent 4a295d6 commit de99af7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scylla-cql/src/types/deserialize/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ where
pub struct VectorIterator<'frame, T> {
coll_typ: &'frame ColumnType,
elem_typ: &'frame ColumnType,
count: usize,
raw_iter: VectorBytesSequenceIterator<'frame>,
phantom_data: std::marker::PhantomData<T>,
}
Expand All @@ -768,6 +769,7 @@ impl<'frame, T> VectorIterator<'frame, T> {
Self {
coll_typ,
elem_typ,
count,
raw_iter: VectorBytesSequenceIterator::new(count, elem_len, slice),
phantom_data: std::marker::PhantomData,
}
Expand Down Expand Up @@ -845,7 +847,7 @@ where

#[inline]
fn size_hint(&self) -> (usize, Option<usize>) {
self.raw_iter.size_hint()
(self.count, Some(self.count))
}
}

Expand Down

0 comments on commit de99af7

Please sign in to comment.