From 6be9a828fa5630b9082245dbed7ec138cf0f3b2a Mon Sep 17 00:00:00 2001 From: Tamo Date: Tue, 31 Jan 2023 12:49:35 +0100 Subject: [PATCH] makes clippy happy --- dump/src/reader/compat/v1_to_v2.rs | 4 ++-- dump/src/reader/v2/settings.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dump/src/reader/compat/v1_to_v2.rs b/dump/src/reader/compat/v1_to_v2.rs index baadd2104..789e8e0b1 100644 --- a/dump/src/reader/compat/v1_to_v2.rs +++ b/dump/src/reader/compat/v1_to_v2.rs @@ -266,7 +266,7 @@ impl From for v2::Settings { ranking_rules .into_iter() // filter out the WordsPosition ranking rule that exists in v1 but not v2 - .filter_map(|ranking_rule| Option::::from(ranking_rule)) + .filter_map(Option::::from) .map(|criterion| criterion.to_string()) .collect() }); @@ -348,7 +348,7 @@ pub(crate) mod test { // tasks let tasks = dump.tasks().collect::>>().unwrap(); 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!(update_files[..].iter().all(|u| u.is_none())); // no update file in dumps v1 diff --git a/dump/src/reader/v2/settings.rs b/dump/src/reader/v2/settings.rs index 9cd363ca5..c7ecb7f9b 100644 --- a/dump/src/reader/v2/settings.rs +++ b/dump/src/reader/v2/settings.rs @@ -237,13 +237,13 @@ impl FromStr for AscDesc { "desc" => Ok(AscDesc::Desc(field_name.to_string())), _ => Err(()), } - } else if text.starts_with("asc(") && text.ends_with(")") { + } else if text.starts_with("asc(") && text.ends_with(')') { 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( - text.strip_prefix("desc(").unwrap().strip_suffix(")").unwrap().to_string(), + text.strip_prefix("desc(").unwrap().strip_suffix(')').unwrap().to_string(), )) } else { Err(())