Apply code review suggestions

This commit is contained in:
Loïc Lecrenier 2022-10-25 09:48:51 +02:00 committed by Tamo
parent 57c07a533a
commit 6f418e73d0
4 changed files with 61 additions and 47 deletions

View file

@ -259,20 +259,17 @@ pub fn swap_index_uid_in_task(task: &mut Task, swap: (&str, &str)) {
| K::Snapshot => {}
};
match &mut task.details {
Some(details) => match details {
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);
}
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);
}
}
_ => {}
},
None => {}
}
_ => (),
}
for index_uid in index_uids {
if index_uid == swap.0 {