fix(api, docker, github, models): Suppress unused variable warnings by adding #[allow(dead_code)]

This commit is contained in:
Félix MARQUET
2025-08-10 11:36:28 +02:00
parent bd36cf5ad9
commit 1ffa17d82e
5 changed files with 7 additions and 3 deletions

View File

@@ -483,7 +483,7 @@ async fn delete_docker_repo(body: RepoRequest, db: Arc<Mutex<Connection>>) -> Re
async fn get_latest_updates(db: Arc<Mutex<Connection>>) -> Result<impl Reply, Rejection> {
let updates = {
let db_guard = db.lock().await;
let _db_guard = db.lock().await;
let db_path = env::var("DB_PATH").unwrap_or_else(|_| "/github-ntfy".to_string());
let versions_path = format!("{}/ghntfy_versions.db", db_path);

View File

@@ -150,8 +150,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let github_releases = github::get_latest_releases(&github_repos, &client, config.github_headers()).await;
let docker_releases = docker::get_latest_docker_releases(&docker_repos, &client, config.docker_headers()).await;
notifications::send_notifications(github_releases, docker_releases, &config, &conn_versions).await;
let _ = notifications::send_notifications(github_releases, docker_releases, &config, &conn_versions).await;
tokio::time::sleep(Duration::from_secs_f64(config.timeout)).await;
}
}
}

View File

@@ -14,6 +14,7 @@ pub struct GithubRelease {
#[derive(Debug, Clone)]
pub struct GithubReleaseInfo {
pub repo: String,
#[allow(dead_code)]
pub name: String,
pub tag_name: String,
pub html_url: String,
@@ -36,6 +37,7 @@ pub struct DockerReleaseInfo {
pub published_at: String,
}
#[allow(dead_code)]
pub struct NotifiedRelease {
pub repo: String,
pub tag_name: String,

View File

@@ -19,6 +19,7 @@ pub async fn send_to_slack(release: DockerReleaseInfo, webhook_url: &str) {
slack::send_docker_notification(&release, webhook_url).await;
}
#[allow(dead_code)]
pub async fn send_notifications(releases: &[DockerReleaseInfo], config: &Config) {
let mut tasks = Vec::new();

View File

@@ -19,6 +19,7 @@ pub async fn send_to_slack(release: GithubReleaseInfo, webhook_url: &str) {
slack::send_github_notification(&release, webhook_url).await;
}
#[allow(dead_code)]
pub async fn send_notifications(releases: &[GithubReleaseInfo], config: &Config) {
let mut tasks = Vec::new();