diff --git a/milli/src/update/index_documents/extract/extract_vector_points.rs b/milli/src/update/index_documents/extract/extract_vector_points.rs index 3a0376511..cdf0b37f0 100644 --- a/milli/src/update/index_documents/extract/extract_vector_points.rs +++ b/milli/src/update/index_documents/extract/extract_vector_points.rs @@ -135,7 +135,7 @@ pub fn extract_vector_points( let del_vectors = extract_vectors(old, document_id, embedder_name)?; let add_vectors = extract_vectors(new, document_id, embedder_name)?; - if add_vectors.len() > u8::MAX.into() { + if add_vectors.len() > usize::from(u8::MAX) { return Err(crate::Error::UserError(crate::UserError::TooManyVectors( document_id().to_string(), add_vectors.len(), @@ -164,7 +164,7 @@ pub fn extract_vector_points( (None, Some(new)) => { // was possibly autogenerated, remove all vectors for that document let add_vectors = extract_vectors(new, document_id, embedder_name)?; - if add_vectors.len() > u8::MAX.into() { + if add_vectors.len() > usize::from(u8::MAX) { return Err(crate::Error::UserError(crate::UserError::TooManyVectors( document_id().to_string(), add_vectors.len(), diff --git a/milli/src/update/index_documents/typed_chunk.rs b/milli/src/update/index_documents/typed_chunk.rs index f8fb30c7b..e12479bee 100644 --- a/milli/src/update/index_documents/typed_chunk.rs +++ b/milli/src/update/index_documents/typed_chunk.rs @@ -407,7 +407,7 @@ pub(crate) fn write_typed_chunk_into_index( // code error if we somehow got the wrong dimension .unwrap(); - if embeddings.embedding_count() > u8::MAX.into() { + if embeddings.embedding_count() > usize::from(u8::MAX) { let external_docid = if let Ok(Some(Ok(index))) = index .external_id_of(wtxn, std::iter::once(docid)) .map(|it| it.into_iter().next())