fix: satisfy newer GitHub clippy lints

This commit is contained in:
2026-04-16 17:13:02 -04:00
parent df771d3f7c
commit 46129d89ae
3 changed files with 41 additions and 51 deletions

View File

@@ -490,36 +490,34 @@ impl NotificationTargetConfig {
match self.target_type.as_str() { match self.target_type.as_str() {
"discord_webhook" => { "discord_webhook" => {
if !config_map.contains_key("webhook_url") { if let Some(endpoint_url) = self.endpoint_url.clone() {
if let Some(endpoint_url) = self.endpoint_url.clone() { config_map
config_map .entry("webhook_url".to_string())
.insert("webhook_url".to_string(), JsonValue::String(endpoint_url)); .or_insert_with(|| JsonValue::String(endpoint_url));
}
} }
} }
"gotify" => { "gotify" => {
if !config_map.contains_key("server_url") { if let Some(endpoint_url) = self.endpoint_url.clone() {
if let Some(endpoint_url) = self.endpoint_url.clone() { config_map
config_map .entry("server_url".to_string())
.insert("server_url".to_string(), JsonValue::String(endpoint_url)); .or_insert_with(|| JsonValue::String(endpoint_url));
}
} }
if !config_map.contains_key("app_token") { if let Some(auth_token) = self.auth_token.clone() {
if let Some(auth_token) = self.auth_token.clone() { config_map
config_map.insert("app_token".to_string(), JsonValue::String(auth_token)); .entry("app_token".to_string())
} .or_insert_with(|| JsonValue::String(auth_token));
} }
} }
"webhook" => { "webhook" => {
if !config_map.contains_key("url") { if let Some(endpoint_url) = self.endpoint_url.clone() {
if let Some(endpoint_url) = self.endpoint_url.clone() { config_map
config_map.insert("url".to_string(), JsonValue::String(endpoint_url)); .entry("url".to_string())
} .or_insert_with(|| JsonValue::String(endpoint_url));
} }
if !config_map.contains_key("auth_token") { if let Some(auth_token) = self.auth_token.clone() {
if let Some(auth_token) = self.auth_token.clone() { config_map
config_map.insert("auth_token".to_string(), JsonValue::String(auth_token)); .entry("auth_token".to_string())
} .or_insert_with(|| JsonValue::String(auth_token));
} }
} }
_ => {} _ => {}

View File

@@ -627,10 +627,11 @@ impl FFmpegProgressState {
} }
} }
"speed" => self.current.speed = value.to_string(), "speed" => self.current.speed = value.to_string(),
"progress" if matches!(value, "continue" | "end") => { "progress"
if self.current.time_seconds > 0.0 || self.current.frame > 0 { if matches!(value, "continue" | "end")
return Some(self.current.clone()); && (self.current.time_seconds > 0.0 || self.current.frame > 0) =>
} {
return Some(self.current.clone());
} }
_ => {} _ => {}
} }

View File

@@ -470,36 +470,27 @@ fn normalize_notification_payload(
} }
} }
"gotify" => { "gotify" => {
if !config_map.contains_key("server_url") { if let Some(endpoint_url) = payload.endpoint_url.as_ref() {
if let Some(endpoint_url) = payload.endpoint_url.as_ref() { config_map
config_map.insert( .entry("server_url".to_string())
"server_url".to_string(), .or_insert_with(|| JsonValue::String(endpoint_url.clone()));
JsonValue::String(endpoint_url.clone()),
);
}
} }
if !config_map.contains_key("app_token") { if let Some(auth_token) = payload.auth_token.as_ref() {
if let Some(auth_token) = payload.auth_token.as_ref() { config_map
config_map.insert( .entry("app_token".to_string())
"app_token".to_string(), .or_insert_with(|| JsonValue::String(auth_token.clone()));
JsonValue::String(auth_token.clone()),
);
}
} }
} }
"webhook" => { "webhook" => {
if !config_map.contains_key("url") { if let Some(endpoint_url) = payload.endpoint_url.as_ref() {
if let Some(endpoint_url) = payload.endpoint_url.as_ref() { config_map
config_map.insert("url".to_string(), JsonValue::String(endpoint_url.clone())); .entry("url".to_string())
} .or_insert_with(|| JsonValue::String(endpoint_url.clone()));
} }
if !config_map.contains_key("auth_token") { if let Some(auth_token) = payload.auth_token.as_ref() {
if let Some(auth_token) = payload.auth_token.as_ref() { config_map
config_map.insert( .entry("auth_token".to_string())
"auth_token".to_string(), .or_insert_with(|| JsonValue::String(auth_token.clone()));
JsonValue::String(auth_token.clone()),
);
}
} }
} }
_ => {} _ => {}