Clippy fixes

This commit is contained in:
mdecimus
2025-01-11 11:43:45 +01:00
parent dc19f20285
commit 3612d5fc5d
67 changed files with 131 additions and 140 deletions

View File

@@ -238,7 +238,7 @@ pub async fn name_to_id(client: &Client, name: &str) -> String {
pub fn is_localhost(url: &str) -> bool {
url.split_once("://")
.map(|(_, url)| url.split_once('/').map_or(url, |(host, _)| host))
.map_or(false, |host| {
.is_some_and(|host| {
let host = host.rsplit_once(':').map_or(host, |(host, _)| host);
host == "localhost" || host == "127.0.0.1" || host == "[::1]"
})