From 9d3037aa1ac86a8e1bf0edba3777bed2d63c880d Mon Sep 17 00:00:00 2001 From: HikariLan Date: Tue, 25 Mar 2025 18:12:36 +0800 Subject: [PATCH] Fix clippy error --- crates/milli/src/search/new/matches/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/milli/src/search/new/matches/mod.rs b/crates/milli/src/search/new/matches/mod.rs index d9009d92b..6a81d7c4d 100644 --- a/crates/milli/src/search/new/matches/mod.rs +++ b/crates/milli/src/search/new/matches/mod.rs @@ -230,7 +230,7 @@ impl<'t, 'tokenizer> Matcher<'t, 'tokenizer, '_, '_> { .iter() .map(|m| MatchBounds { start: tokens[m.get_first_token_pos()].byte_start, - length: self.calc_byte_length(&tokens, m), + length: self.calc_byte_length(tokens, m), indices: if array_indices.is_empty() { None } else { @@ -241,7 +241,7 @@ impl<'t, 'tokenizer> Matcher<'t, 'tokenizer, '_, '_> { } } - fn calc_byte_length(&self, tokens: &Vec>, m: &Match) -> usize { + fn calc_byte_length(&self, tokens: &[Token<'t>], m: &Match) -> usize { (m.get_first_token_pos()..=m.get_last_token_pos()) .flat_map(|i| match &tokens[i].char_map { Some(char_map) => {