fix clippy

This commit is contained in:
Irevoire 2022-10-25 10:58:55 +02:00 committed by Clément Renault
parent 7e52f1effb
commit 9c00b159ba
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
2 changed files with 9 additions and 11 deletions

View File

@ -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 {

View File

@ -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)