From 72dcb0aa2de4deacf5adb4a5d6cc33f604963279 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Fri, 20 Mar 2026 13:14:46 -0400 Subject: [PATCH] [cargo] Clean --- ntfy-daemon/src/credentials.rs | 2 -- ntfy-daemon/src/http_client.rs | 2 -- ntfy-daemon/src/listener.rs | 4 ++-- ntfy-daemon/src/message_repo/mod.rs | 1 - ntfy-daemon/src/models.rs | 2 +- ntfy-daemon/src/ntfy.rs | 8 +++----- 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/ntfy-daemon/src/credentials.rs b/ntfy-daemon/src/credentials.rs index afab621..9ef1204 100644 --- a/ntfy-daemon/src/credentials.rs +++ b/ntfy-daemon/src/credentials.rs @@ -1,6 +1,4 @@ -use std::cell::RefCell; use std::collections::HashMap; -use std::rc::Rc; use std::sync::{Arc, RwLock}; use async_trait::async_trait; diff --git a/ntfy-daemon/src/http_client.rs b/ntfy-daemon/src/http_client.rs index cd58ce8..17b8d1b 100644 --- a/ntfy-daemon/src/http_client.rs +++ b/ntfy-daemon/src/http_client.rs @@ -1,14 +1,12 @@ use anyhow::Result; use async_trait::async_trait; use reqwest::{header::HeaderMap, Client, Request, RequestBuilder, Response, ResponseBuilderExt}; -use serde_json::{json, Value}; use std::collections::{HashMap, VecDeque}; use std::sync::Arc; use std::time::Duration; use tokio::sync::RwLock; use tokio::time; -use crate::models; use crate::output_tracker::OutputTrackerAsync; // Structure to store request information for verification diff --git a/ntfy-daemon/src/listener.rs b/ntfy-daemon/src/listener.rs index 49141fa..362e533 100644 --- a/ntfy-daemon/src/listener.rs +++ b/ntfy-daemon/src/listener.rs @@ -4,13 +4,13 @@ use std::time::Duration; use futures::{StreamExt, TryStreamExt}; use serde::{Deserialize, Serialize}; use tokio::io::AsyncBufReadExt; -use tokio::task::{self, spawn_local, LocalSet}; +use tokio::task::{spawn_local, LocalSet}; use tokio::{ select, sync::{mpsc, oneshot}, }; use tokio_stream::wrappers::LinesStream; -use tracing::{debug, error, info, warn, Instrument, Span}; +use tracing::{debug, error, info, warn, Instrument}; use crate::credentials::Credentials; use crate::http_client::HttpClient; diff --git a/ntfy-daemon/src/message_repo/mod.rs b/ntfy-daemon/src/message_repo/mod.rs index bd197b1..cb9c889 100644 --- a/ntfy-daemon/src/message_repo/mod.rs +++ b/ntfy-daemon/src/message_repo/mod.rs @@ -1,5 +1,4 @@ use std::sync::{Arc, RwLock}; -use std::{cell::RefCell, rc::Rc}; use rusqlite::{params, Connection, Result}; use tracing::info; diff --git a/ntfy-daemon/src/models.rs b/ntfy-daemon/src/models.rs index a41edeb..89aa7e9 100644 --- a/ntfy-daemon/src/models.rs +++ b/ntfy-daemon/src/models.rs @@ -388,7 +388,7 @@ impl NullNotifier { } } impl NotificationProxy for NullNotifier { - fn send(&self, n: Notification) -> anyhow::Result<()> { + fn send(&self, _n: Notification) -> anyhow::Result<()> { Ok(()) } } diff --git a/ntfy-daemon/src/ntfy.rs b/ntfy-daemon/src/ntfy.rs index 7407f2f..50e9f33 100644 --- a/ntfy-daemon/src/ntfy.rs +++ b/ntfy-daemon/src/ntfy.rs @@ -1,14 +1,12 @@ use crate::actor_utils::send_command; -use crate::models::NullNetworkMonitor; -use crate::models::NullNotifier; use anyhow::{anyhow, Context}; use futures::future::join_all; use futures::StreamExt; use std::{collections::HashMap, future::Future, sync::Arc}; use tokio::select; use tokio::{ - sync::{broadcast, mpsc, oneshot, RwLock}, - task::{spawn_local, LocalSet}, + sync::{mpsc, oneshot, RwLock}, + task::LocalSet, }; use tracing::{error, info}; @@ -16,7 +14,7 @@ use crate::{ http_client::HttpClient, message_repo::Db, models::{self, Account}, - ListenerActor, ListenerCommand, ListenerConfig, ListenerHandle, SharedEnv, SubscriptionHandle, + ListenerConfig, ListenerHandle, SharedEnv, SubscriptionHandle, }; const CONNECT_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(15);