From 3600ef77fc29ec99e626a8742199f518c714ca42 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 10 Nov 2023 11:48:52 -0800 Subject: [PATCH] fix: clippy warnings in CodeSearchSchema --- crates/tabby-common/src/index.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/tabby-common/src/index.rs b/crates/tabby-common/src/index.rs index eec2549..14926f8 100644 --- a/crates/tabby-common/src/index.rs +++ b/crates/tabby-common/src/index.rs @@ -5,8 +5,8 @@ use tantivy::{ Index, Term, }; -pub static CODE_TOKENIZER: &str = "code"; -pub static IDENTIFIER_TOKENIZER: &str = "identifier"; +static CODE_TOKENIZER: &str = "code"; +static IDENTIFIER_TOKENIZER: &str = "identifier"; pub fn register_tokenizers(index: &Index) { let code_tokenizer = TextAnalyzer::builder(RegexTokenizer::new(r"(?:\w+)").unwrap()) @@ -71,6 +71,12 @@ impl CodeSearchSchema { } } +impl Default for CodeSearchSchema { + fn default() -> Self { + Self::new() + } +} + impl CodeSearchSchema { pub fn language_query(&self, language: &str) -> Box { Box::new(TermQuery::new(