mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Apply code review suggestions
This commit is contained in:
parent
57c07a533a
commit
6f418e73d0
4 changed files with 61 additions and 47 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue