From 7dd1226faf595eb9429bf68f48a4229dd96ce13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 28 Nov 2023 14:26:31 +0100 Subject: [PATCH] Clarify an unreachable unwrap --- milli/src/heed_codec/str_beu32_codec.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/milli/src/heed_codec/str_beu32_codec.rs b/milli/src/heed_codec/str_beu32_codec.rs index c76ea2a26..e3ffddcd6 100644 --- a/milli/src/heed_codec/str_beu32_codec.rs +++ b/milli/src/heed_codec/str_beu32_codec.rs @@ -54,6 +54,7 @@ impl<'a> heed::BytesDecode<'a> for StrBEU16Codec { } let (word_plus_nul_byte, bytes) = bytes.split_at(bytes.len() - footer_len); + // unwrap: we just checked the footer + 1 above. let (_, word) = word_plus_nul_byte.split_last().unwrap(); let word = str::from_utf8(word)?; let pos = bytes.try_into().map(u16::from_be_bytes)?;