From 9c00b159ba0dd7f7eb04e482faf8450bc85687e2 Mon Sep 17 00:00:00 2001 From: Irevoire Date: Tue, 25 Oct 2022 10:58:55 +0200 Subject: [PATCH] fix clippy --- index-scheduler/src/utils.rs | 17 +++++++---------- meili-snap/src/lib.rs | 3 ++- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/index-scheduler/src/utils.rs b/index-scheduler/src/utils.rs index 5bde9660b..e22e6157e 100644 --- a/index-scheduler/src/utils.rs +++ b/index-scheduler/src/utils.rs @@ -258,18 +258,15 @@ pub fn swap_index_uid_in_task(task: &mut Task, swap: (&str, &str)) { | K::DumpCreation { .. } | K::Snapshot => {} }; - match &mut task.details { - Some(Details::IndexSwap { swaps }) => { - for (lhs, rhs) in swaps.iter_mut() { - if lhs == swap.0 || lhs == swap.1 { - index_uids.push(lhs); - } - if rhs == swap.0 || rhs == swap.1 { - index_uids.push(rhs); - } + if let Some(Details::IndexSwap { swaps }) = &mut task.details { + for (lhs, rhs) in swaps.iter_mut() { + if lhs == swap.0 || lhs == swap.1 { + index_uids.push(lhs); + } + if rhs == swap.0 || rhs == swap.1 { + index_uids.push(rhs); } } - _ => (), } for index_uid in index_uids { if index_uid == swap.0 { diff --git a/meili-snap/src/lib.rs b/meili-snap/src/lib.rs index 94482eaf8..a2abd0cea 100644 --- a/meili-snap/src/lib.rs +++ b/meili-snap/src/lib.rs @@ -40,7 +40,8 @@ pub fn default_snapshot_settings_for_test<'a>( Cow::Owned(format!("{counter}")) }; - let store_whole_snapshot = std::env::var("MEILI_TEST_FULL_SNAPS").unwrap_or("false".to_owned()); + let store_whole_snapshot = + std::env::var("MEILI_TEST_FULL_SNAPS").unwrap_or_else(|_| "false".to_owned()); let store_whole_snapshot: bool = store_whole_snapshot.parse().unwrap(); (settings, snap_name, store_whole_snapshot)