mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
Run the code formatter
This commit is contained in:
parent
be1c6f9dc4
commit
63e1fb4f96
2 changed files with 60 additions and 69 deletions
|
@ -92,77 +92,68 @@ impl HeedAuthStore {
|
|||
Action::into_enum_iter().collect()
|
||||
} else if key.actions.contains(&Action::DocumentsAll) {
|
||||
// if key.actions.contains.DocumentsAll add all actions related to documents.
|
||||
key.actions.iter()
|
||||
.cloned()
|
||||
.filter(|action|{ // Prevents duplicate entries in the actions vector
|
||||
*action != Action::DocumentsAdd &&
|
||||
*action != Action::DocumentsDelete &&
|
||||
*action != Action::DocumentsGet
|
||||
})
|
||||
.chain(vec![
|
||||
Action::DocumentsAdd,
|
||||
Action::DocumentsDelete,
|
||||
Action::DocumentsGet
|
||||
])
|
||||
.collect()
|
||||
key.actions
|
||||
.iter()
|
||||
.cloned()
|
||||
.filter(|action| {
|
||||
// Prevents duplicate entries in the actions vector
|
||||
*action != Action::DocumentsAdd
|
||||
&& *action != Action::DocumentsDelete
|
||||
&& *action != Action::DocumentsGet
|
||||
})
|
||||
.chain(vec![
|
||||
Action::DocumentsAdd,
|
||||
Action::DocumentsDelete,
|
||||
Action::DocumentsGet,
|
||||
])
|
||||
.collect()
|
||||
} else if key.actions.contains(&Action::IndexesAll) {
|
||||
key.actions.iter()
|
||||
.cloned()
|
||||
.filter(|action|{
|
||||
*action != Action::IndexesAdd &&
|
||||
*action != Action::IndexesGet &&
|
||||
*action != Action::IndexesDelete &&
|
||||
*action != Action::IndexesUpdate
|
||||
})
|
||||
.chain(vec![
|
||||
Action::IndexesAdd,
|
||||
Action::IndexesGet,
|
||||
Action::IndexesDelete,
|
||||
Action::IndexesUpdate
|
||||
])
|
||||
.collect()
|
||||
key.actions
|
||||
.iter()
|
||||
.cloned()
|
||||
.filter(|action| {
|
||||
*action != Action::IndexesAdd
|
||||
&& *action != Action::IndexesGet
|
||||
&& *action != Action::IndexesDelete
|
||||
&& *action != Action::IndexesUpdate
|
||||
})
|
||||
.chain(vec![
|
||||
Action::IndexesAdd,
|
||||
Action::IndexesGet,
|
||||
Action::IndexesDelete,
|
||||
Action::IndexesUpdate,
|
||||
])
|
||||
.collect()
|
||||
} else if key.actions.contains(&Action::SettingsAll) {
|
||||
key.actions.iter()
|
||||
.cloned()
|
||||
.filter(|action|{
|
||||
*action != Action::SettingsGet &&
|
||||
*action != Action::SettingsUpdate
|
||||
})
|
||||
.chain(vec![
|
||||
Action::SettingsGet,
|
||||
Action::SettingsUpdate
|
||||
])
|
||||
.collect()
|
||||
key.actions
|
||||
.iter()
|
||||
.cloned()
|
||||
.filter(|action| {
|
||||
*action != Action::SettingsGet && *action != Action::SettingsUpdate
|
||||
})
|
||||
.chain(vec![Action::SettingsGet, Action::SettingsUpdate])
|
||||
.collect()
|
||||
} else if key.actions.contains(&Action::TasksAll) {
|
||||
key.actions.iter()
|
||||
.cloned()
|
||||
.filter(|action|{
|
||||
*action != Action::TasksGet
|
||||
})
|
||||
.chain(vec![
|
||||
Action::TasksGet
|
||||
])
|
||||
.collect()
|
||||
key.actions
|
||||
.iter()
|
||||
.cloned()
|
||||
.filter(|action| *action != Action::TasksGet)
|
||||
.chain(vec![Action::TasksGet])
|
||||
.collect()
|
||||
} else if key.actions.contains(&Action::DumpsAll) {
|
||||
key.actions.iter()
|
||||
.cloned()
|
||||
.filter(|action|{
|
||||
*action != Action::DumpsCreate
|
||||
})
|
||||
.chain(vec![
|
||||
Action::DumpsCreate
|
||||
])
|
||||
.collect()
|
||||
key.actions
|
||||
.iter()
|
||||
.cloned()
|
||||
.filter(|action| *action != Action::DumpsCreate)
|
||||
.chain(vec![Action::DumpsCreate])
|
||||
.collect()
|
||||
} else if key.actions.contains(&Action::StatsAll) {
|
||||
key.actions.iter()
|
||||
.cloned()
|
||||
.filter(|action|{
|
||||
*action != Action::StatsGet
|
||||
})
|
||||
.chain(vec![
|
||||
Action::StatsGet
|
||||
])
|
||||
.collect()
|
||||
key.actions
|
||||
.iter()
|
||||
.cloned()
|
||||
.filter(|action| *action != Action::StatsGet)
|
||||
.chain(vec![Action::StatsGet])
|
||||
.collect()
|
||||
} else {
|
||||
key.actions.clone()
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue