mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-07-22 23:38:10 -07:00
Clippy fixes
This commit is contained in:
@@ -51,7 +51,7 @@ impl NotificationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_handler(&self) -> mpsc::Sender<Notification> {
|
pub fn new_handler(&self) -> mpsc::Sender<Notification> {
|
||||||
return self.tx.clone();
|
self.tx.clone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ pub fn run_notification_worker(
|
|||||||
task_tracker.spawn(async move {
|
task_tracker.spawn(async move {
|
||||||
let channel_name = notification_service.channel_name.unwrap_or("".into());
|
let channel_name = notification_service.channel_name.unwrap_or("".into());
|
||||||
|
|
||||||
if channel_name != String::from("") {
|
if !channel_name.is_empty() {
|
||||||
let mut notification_statuses = HashMap::new();
|
let mut notification_statuses = HashMap::new();
|
||||||
let http_client = reqwest::Client::new();
|
let http_client = reqwest::Client::new();
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ pub fn run_notification_worker(
|
|||||||
}
|
}
|
||||||
|
|
||||||
match http_client
|
match http_client
|
||||||
.post(format!("{}{}", NTFY_BASE_URL, channel_name))
|
.post(format!("{NTFY_BASE_URL}{channel_name}"))
|
||||||
.body(notification.message.clone())
|
.body(notification.message.clone())
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
@@ -133,7 +133,7 @@ pub fn run_notification_worker(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("Failed to send notification to ntfy: {}", e);
|
error!("Failed to send notification to ntfy: {e}");
|
||||||
notification.failed_since_last_success += 1;
|
notification.failed_since_last_success += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user