makes clippy happy

This commit is contained in:
Tamo 2023-01-31 12:49:35 +01:00
parent 4b7b2d6a90
commit 6be9a828fa
2 changed files with 6 additions and 6 deletions

View File

@ -266,7 +266,7 @@ impl From<v1::settings::SettingsUpdate> for v2::Settings<v2::Unchecked> {
ranking_rules ranking_rules
.into_iter() .into_iter()
// filter out the WordsPosition ranking rule that exists in v1 but not v2 // filter out the WordsPosition ranking rule that exists in v1 but not v2
.filter_map(|ranking_rule| Option::<v2::settings::Criterion>::from(ranking_rule)) .filter_map(Option::<v2::settings::Criterion>::from)
.map(|criterion| criterion.to_string()) .map(|criterion| criterion.to_string())
.collect() .collect()
}); });
@ -348,7 +348,7 @@ pub(crate) mod test {
// tasks // tasks
let tasks = dump.tasks().collect::<Result<Vec<_>>>().unwrap(); let tasks = dump.tasks().collect::<Result<Vec<_>>>().unwrap();
let (tasks, update_files): (Vec<_>, Vec<_>) = tasks.into_iter().unzip(); let (tasks, update_files): (Vec<_>, Vec<_>) = tasks.into_iter().unzip();
meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"ad6245d98d1a8e30535f3339a9a8d223"); meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"2298010973ee98cf4670787314176a3a");
assert_eq!(update_files.len(), 9); assert_eq!(update_files.len(), 9);
assert!(update_files[..].iter().all(|u| u.is_none())); // no update file in dumps v1 assert!(update_files[..].iter().all(|u| u.is_none())); // no update file in dumps v1

View File

@ -237,13 +237,13 @@ impl FromStr for AscDesc {
"desc" => Ok(AscDesc::Desc(field_name.to_string())), "desc" => Ok(AscDesc::Desc(field_name.to_string())),
_ => Err(()), _ => Err(()),
} }
} else if text.starts_with("asc(") && text.ends_with(")") { } else if text.starts_with("asc(") && text.ends_with(')') {
Ok(AscDesc::Asc( Ok(AscDesc::Asc(
text.strip_prefix("asc(").unwrap().strip_suffix(")").unwrap().to_string(), text.strip_prefix("asc(").unwrap().strip_suffix(')').unwrap().to_string(),
)) ))
} else if text.starts_with("desc(") && text.ends_with(")") { } else if text.starts_with("desc(") && text.ends_with(')') {
Ok(AscDesc::Desc( Ok(AscDesc::Desc(
text.strip_prefix("desc(").unwrap().strip_suffix(")").unwrap().to_string(), text.strip_prefix("desc(").unwrap().strip_suffix(')').unwrap().to_string(),
)) ))
} else { } else {
Err(()) Err(())