diff --git a/scylla-cql/src/types/serialize/raw_batch.rs b/scylla-cql/src/types/serialize/raw_batch.rs index b59ba88ed..6c755c5e8 100644 --- a/scylla-cql/src/types/serialize/raw_batch.rs +++ b/scylla-cql/src/types/serialize/raw_batch.rs @@ -52,11 +52,7 @@ pub trait RawBatchValuesIterator<'a> { where Self: Sized, { - let mut count = 0; - while self.skip_next().is_some() { - count += 1; - } - count + std::iter::from_fn(|| self.skip_next()).count() } }