From 677bb39e73f7e6c416bf05d4dd5cbf4bf43863d7 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 8 Jan 2025 15:22:11 +0100 Subject: [PATCH] Modernize valid_lmdb_key --- crates/milli/src/update/index_documents/helpers/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/milli/src/update/index_documents/helpers/mod.rs b/crates/milli/src/update/index_documents/helpers/mod.rs index 236c63cc3..5dec54ffc 100644 --- a/crates/milli/src/update/index_documents/helpers/mod.rs +++ b/crates/milli/src/update/index_documents/helpers/mod.rs @@ -10,10 +10,10 @@ use fst::{IntoStreamer, Streamer}; pub use grenad_helpers::*; pub use merge_functions::*; -use crate::{MAX_LMDB_KEY_LENGTH, MAX_WORD_LENGTH}; +use crate::MAX_LMDB_KEY_LENGTH; pub fn valid_lmdb_key(key: impl AsRef<[u8]>) -> bool { - key.as_ref().len() <= MAX_WORD_LENGTH * 2 && !key.as_ref().is_empty() + key.as_ref().len() <= MAX_LMDB_KEY_LENGTH - 3 && !key.as_ref().is_empty() } pub fn valid_facet_value(facet_value: impl AsRef<[u8]>) -> bool {