mirror of
https://codeberg.org/likwid/likwid.git
synced 2026-03-26 19:03:08 +00:00
ci: apply rustfmt + fix clippy warning
This commit is contained in:
parent
e16a36f13c
commit
40fd87aeae
4 changed files with 11 additions and 7 deletions
|
|
@ -488,9 +488,9 @@ async fn enforce_registry_allowlist(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if pattern.starts_with("*.") {
|
if let Some(stripped) = pattern.strip_prefix("*.") {
|
||||||
let suffix = &pattern[1..];
|
let suffix = format!(".{stripped}");
|
||||||
host.ends_with(suffix) || host.eq_ignore_ascii_case(&pattern[2..])
|
host.ends_with(&suffix) || host.eq_ignore_ascii_case(stripped)
|
||||||
} else {
|
} else {
|
||||||
host.eq_ignore_ascii_case(pattern)
|
host.eq_ignore_ascii_case(pattern)
|
||||||
}
|
}
|
||||||
|
|
@ -529,7 +529,10 @@ async fn enforce_registry_allowlist(
|
||||||
v4.is_loopback() || v4.is_private() || v4.is_link_local() || v4.is_unspecified()
|
v4.is_loopback() || v4.is_private() || v4.is_link_local() || v4.is_unspecified()
|
||||||
}
|
}
|
||||||
IpAddr::V6(v6) => {
|
IpAddr::V6(v6) => {
|
||||||
v6.is_loopback() || v6.is_unique_local() || v6.is_unicast_link_local() || v6.is_unspecified()
|
v6.is_loopback()
|
||||||
|
|| v6.is_unique_local()
|
||||||
|
|| v6.is_unicast_link_local()
|
||||||
|
|| v6.is_unspecified()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ use serde::{Deserialize, Serialize};
|
||||||
use sqlx::PgPool;
|
use sqlx::PgPool;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use crate::auth::AuthUser;
|
|
||||||
use crate::api::permissions::{perms, require_permission};
|
use crate::api::permissions::{perms, require_permission};
|
||||||
|
use crate::auth::AuthUser;
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Types
|
// Types
|
||||||
|
|
|
||||||
|
|
@ -277,7 +277,8 @@ async fn complete_setup(
|
||||||
if req.instance_type != "single_community" && req.platform_mode == "single_community" {
|
if req.instance_type != "single_community" && req.platform_mode == "single_community" {
|
||||||
return Err((
|
return Err((
|
||||||
StatusCode::BAD_REQUEST,
|
StatusCode::BAD_REQUEST,
|
||||||
"Platform mode 'single_community' requires instance type 'single_community'".to_string(),
|
"Platform mode 'single_community' requires instance type 'single_community'"
|
||||||
|
.to_string(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
if req.platform_mode == "single_community" {
|
if req.platform_mode == "single_community" {
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ use serde::{Deserialize, Serialize};
|
||||||
use sqlx::PgPool;
|
use sqlx::PgPool;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use crate::auth::AuthUser;
|
|
||||||
use crate::api::permissions::{perms, require_permission};
|
use crate::api::permissions::{perms, require_permission};
|
||||||
|
use crate::auth::AuthUser;
|
||||||
use crate::models::user::UserResponse;
|
use crate::models::user::UserResponse;
|
||||||
|
|
||||||
pub fn router(pool: PgPool) -> Router {
|
pub fn router(pool: PgPool) -> Router {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue