mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-01 17:00:21 +08:00
Fix legacy user policy modes for empty lists
This commit is contained in:
@@ -572,7 +572,7 @@ fn imported_optional_rate_limit_policy_mode(
|
||||
}
|
||||
|
||||
fn legacy_imported_list_policy_mode(values: &Option<Vec<String>>) -> String {
|
||||
if values.is_some() {
|
||||
if values.as_ref().is_some_and(|items| !items.is_empty()) {
|
||||
"specific".to_string()
|
||||
} else {
|
||||
"unrestricted".to_string()
|
||||
|
||||
@@ -300,7 +300,7 @@ pub(crate) fn normalize_admin_rate_limit_policy_mode(value: &str) -> Result<Stri
|
||||
}
|
||||
|
||||
pub(super) fn legacy_admin_list_policy_mode(values: &Option<Vec<String>>) -> String {
|
||||
if values.is_some() {
|
||||
if values.as_ref().is_some_and(|items| !items.is_empty()) {
|
||||
"specific".to_string()
|
||||
} else {
|
||||
"unrestricted".to_string()
|
||||
|
||||
Reference in New Issue
Block a user