mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-31 15:31:53 +08:00
Fix clippy
This commit is contained in:
parent
9c485f8563
commit
d4ff59fcf5
@ -1065,7 +1065,7 @@ impl Index {
|
|||||||
self.main.delete::<_, Str>(wtxn, main_key::NON_SEPARATOR_TOKENS_KEY)
|
self.main.delete::<_, Str>(wtxn, main_key::NON_SEPARATOR_TOKENS_KEY)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn non_separator_tokens<'t>(&self, rtxn: &'t RoTxn) -> Result<Option<BTreeSet<String>>> {
|
pub fn non_separator_tokens(&self, rtxn: &RoTxn) -> Result<Option<BTreeSet<String>>> {
|
||||||
Ok(self.main.get::<_, Str, SerdeBincode<BTreeSet<String>>>(
|
Ok(self.main.get::<_, Str, SerdeBincode<BTreeSet<String>>>(
|
||||||
rtxn,
|
rtxn,
|
||||||
main_key::NON_SEPARATOR_TOKENS_KEY,
|
main_key::NON_SEPARATOR_TOKENS_KEY,
|
||||||
@ -1086,7 +1086,7 @@ impl Index {
|
|||||||
self.main.delete::<_, Str>(wtxn, main_key::SEPARATOR_TOKENS_KEY)
|
self.main.delete::<_, Str>(wtxn, main_key::SEPARATOR_TOKENS_KEY)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn separator_tokens<'t>(&self, rtxn: &'t RoTxn) -> Result<Option<BTreeSet<String>>> {
|
pub fn separator_tokens(&self, rtxn: &RoTxn) -> Result<Option<BTreeSet<String>>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.main
|
.main
|
||||||
.get::<_, Str, SerdeBincode<BTreeSet<String>>>(rtxn, main_key::SEPARATOR_TOKENS_KEY)?)
|
.get::<_, Str, SerdeBincode<BTreeSet<String>>>(rtxn, main_key::SEPARATOR_TOKENS_KEY)?)
|
||||||
@ -1094,7 +1094,7 @@ impl Index {
|
|||||||
|
|
||||||
/* separators easing method */
|
/* separators easing method */
|
||||||
|
|
||||||
pub fn allowed_separators<'t>(&self, rtxn: &'t RoTxn) -> Result<Option<BTreeSet<String>>> {
|
pub fn allowed_separators(&self, rtxn: &RoTxn) -> Result<Option<BTreeSet<String>>> {
|
||||||
let default_separators =
|
let default_separators =
|
||||||
charabia::separators::DEFAULT_SEPARATORS.iter().map(|s| s.to_string());
|
charabia::separators::DEFAULT_SEPARATORS.iter().map(|s| s.to_string());
|
||||||
let mut separators: Option<BTreeSet<_>> = None;
|
let mut separators: Option<BTreeSet<_>> = None;
|
||||||
@ -1126,7 +1126,7 @@ impl Index {
|
|||||||
self.main.delete::<_, Str>(wtxn, main_key::DICTIONARY_KEY)
|
self.main.delete::<_, Str>(wtxn, main_key::DICTIONARY_KEY)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn dictionary<'t>(&self, rtxn: &'t RoTxn) -> Result<Option<BTreeSet<String>>> {
|
pub fn dictionary(&self, rtxn: &RoTxn) -> Result<Option<BTreeSet<String>>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.main
|
.main
|
||||||
.get::<_, Str, SerdeBincode<BTreeSet<String>>>(rtxn, main_key::DICTIONARY_KEY)?)
|
.get::<_, Str, SerdeBincode<BTreeSet<String>>>(rtxn, main_key::DICTIONARY_KEY)?)
|
||||||
|
@ -497,7 +497,7 @@ impl<'a, 't, 'u, 'i> Settings<'a, 't, 'u, 'i> {
|
|||||||
|
|
||||||
// Does the new list differ from the previous one?
|
// Does the new list differ from the previous one?
|
||||||
if current.map_or(true, |current| ¤t != non_separator_tokens) {
|
if current.map_or(true, |current| ¤t != non_separator_tokens) {
|
||||||
self.index.put_non_separator_tokens(self.wtxn, &non_separator_tokens)?;
|
self.index.put_non_separator_tokens(self.wtxn, non_separator_tokens)?;
|
||||||
Ok(true)
|
Ok(true)
|
||||||
} else {
|
} else {
|
||||||
Ok(false)
|
Ok(false)
|
||||||
@ -515,7 +515,7 @@ impl<'a, 't, 'u, 'i> Settings<'a, 't, 'u, 'i> {
|
|||||||
|
|
||||||
// Does the new list differ from the previous one?
|
// Does the new list differ from the previous one?
|
||||||
if current.map_or(true, |current| ¤t != separator_tokens) {
|
if current.map_or(true, |current| ¤t != separator_tokens) {
|
||||||
self.index.put_separator_tokens(self.wtxn, &separator_tokens)?;
|
self.index.put_separator_tokens(self.wtxn, separator_tokens)?;
|
||||||
Ok(true)
|
Ok(true)
|
||||||
} else {
|
} else {
|
||||||
Ok(false)
|
Ok(false)
|
||||||
@ -533,7 +533,7 @@ impl<'a, 't, 'u, 'i> Settings<'a, 't, 'u, 'i> {
|
|||||||
|
|
||||||
// Does the new list differ from the previous one?
|
// Does the new list differ from the previous one?
|
||||||
if current.map_or(true, |current| ¤t != dictionary) {
|
if current.map_or(true, |current| ¤t != dictionary) {
|
||||||
self.index.put_dictionary(self.wtxn, &dictionary)?;
|
self.index.put_dictionary(self.wtxn, dictionary)?;
|
||||||
Ok(true)
|
Ok(true)
|
||||||
} else {
|
} else {
|
||||||
Ok(false)
|
Ok(false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user