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() {
"discord_webhook" => {
if !config_map.contains_key("webhook_url") {
if let Some(endpoint_url) = self.endpoint_url.clone() {
config_map
.insert("webhook_url".to_string(), JsonValue::String(endpoint_url));
}
if let Some(endpoint_url) = self.endpoint_url.clone() {
config_map
.entry("webhook_url".to_string())
.or_insert_with(|| JsonValue::String(endpoint_url));
}
}
"gotify" => {
if !config_map.contains_key("server_url") {
if let Some(endpoint_url) = self.endpoint_url.clone() {
config_map
.insert("server_url".to_string(), JsonValue::String(endpoint_url));
}
if let Some(endpoint_url) = self.endpoint_url.clone() {
config_map
.entry("server_url".to_string())
.or_insert_with(|| JsonValue::String(endpoint_url));
}
if !config_map.contains_key("app_token") {
if let Some(auth_token) = self.auth_token.clone() {
config_map.insert("app_token".to_string(), JsonValue::String(auth_token));
}
if let Some(auth_token) = self.auth_token.clone() {
config_map
.entry("app_token".to_string())
.or_insert_with(|| JsonValue::String(auth_token));
}
}
"webhook" => {
if !config_map.contains_key("url") {
if let Some(endpoint_url) = self.endpoint_url.clone() {
config_map.insert("url".to_string(), JsonValue::String(endpoint_url));
}
if let Some(endpoint_url) = self.endpoint_url.clone() {
config_map
.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() {
config_map.insert("auth_token".to_string(), JsonValue::String(auth_token));
}
if let Some(auth_token) = self.auth_token.clone() {
config_map
.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(),
"progress" if matches!(value, "continue" | "end") => {
if self.current.time_seconds > 0.0 || self.current.frame > 0 {
return Some(self.current.clone());
}
"progress"
if matches!(value, "continue" | "end")
&& (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" => {
if !config_map.contains_key("server_url") {
if let Some(endpoint_url) = payload.endpoint_url.as_ref() {
config_map.insert(
"server_url".to_string(),
JsonValue::String(endpoint_url.clone()),
);
}
if let Some(endpoint_url) = payload.endpoint_url.as_ref() {
config_map
.entry("server_url".to_string())
.or_insert_with(|| JsonValue::String(endpoint_url.clone()));
}
if !config_map.contains_key("app_token") {
if let Some(auth_token) = payload.auth_token.as_ref() {
config_map.insert(
"app_token".to_string(),
JsonValue::String(auth_token.clone()),
);
}
if let Some(auth_token) = payload.auth_token.as_ref() {
config_map
.entry("app_token".to_string())
.or_insert_with(|| JsonValue::String(auth_token.clone()));
}
}
"webhook" => {
if !config_map.contains_key("url") {
if let Some(endpoint_url) = payload.endpoint_url.as_ref() {
config_map.insert("url".to_string(), JsonValue::String(endpoint_url.clone()));
}
if let Some(endpoint_url) = payload.endpoint_url.as_ref() {
config_map
.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() {
config_map.insert(
"auth_token".to_string(),
JsonValue::String(auth_token.clone()),
);
}
if let Some(auth_token) = payload.auth_token.as_ref() {
config_map
.entry("auth_token".to_string())
.or_insert_with(|| JsonValue::String(auth_token.clone()));
}
}
_ => {}