diff --git a/milli/src/index.rs b/milli/src/index.rs index 8343515cf..a22901993 100644 --- a/milli/src/index.rs +++ b/milli/src/index.rs @@ -542,7 +542,7 @@ impl Index { main_key::VECTOR_HNSW_KEY_PREFIX.as_bytes(), )?; let mut deleted = false; - while let Some(_) = iter.next().transpose()? { + while iter.next().transpose()?.is_some() { // We do not keep a reference to the key or the value. unsafe { deleted |= iter.del_current()? }; } diff --git a/milli/src/readable_slices.rs b/milli/src/readable_slices.rs index 9ba6c1ba1..7f5be214f 100644 --- a/milli/src/readable_slices.rs +++ b/milli/src/readable_slices.rs @@ -54,9 +54,10 @@ impl> Read for ReadableSlices { #[cfg(test)] mod test { - use super::ReadableSlices; use std::io::Read; + use super::ReadableSlices; + #[test] fn basic() { let data: Vec<_> = (0..100).collect();