mirror of
https://github.com/bybrooklyn/alchemist.git
synced 2026-04-18 01:43:34 -04:00
fix: satisfy newer GitHub clippy lints
This commit is contained in:
@@ -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));
|
||||
}
|
||||
.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));
|
||||
.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));
|
||||
}
|
||||
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));
|
||||
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));
|
||||
}
|
||||
config_map
|
||||
.entry("auth_token".to_string())
|
||||
.or_insert_with(|| JsonValue::String(auth_token));
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
||||
@@ -627,11 +627,12 @@ 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 {
|
||||
"progress"
|
||||
if matches!(value, "continue" | "end")
|
||||
&& (self.current.time_seconds > 0.0 || self.current.frame > 0) =>
|
||||
{
|
||||
return Some(self.current.clone());
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()),
|
||||
);
|
||||
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()),
|
||||
);
|
||||
}
|
||||
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()));
|
||||
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()),
|
||||
);
|
||||
}
|
||||
config_map
|
||||
.entry("auth_token".to_string())
|
||||
.or_insert_with(|| JsonValue::String(auth_token.clone()));
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
||||
Reference in New Issue
Block a user