Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
chore: cleanup unnecessary clippy allows (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello authored May 6, 2024
1 parent 281af61 commit ae707cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 0 additions & 2 deletions hook-common/src/kafka_messages/plugin_logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ use uuid::Uuid;

use super::serialize_datetime;

#[allow(dead_code)]
#[derive(Serialize)]
pub enum PluginLogEntrySource {
System,
Plugin,
Console,
}

#[allow(dead_code)]
#[derive(Serialize)]
pub enum PluginLogEntryType {
Debug,
Expand Down
13 changes: 3 additions & 10 deletions hook-worker/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ use futures::future::join_all;
use health::HealthHandle;
use hook_common::pgqueue::PgTransactionBatch;
use hook_common::{
pgqueue::{
DatabaseError, Job, PgQueue, PgQueueJob, PgTransactionJob, RetryError, RetryInvalidError,
},
pgqueue::{Job, PgQueue, PgQueueJob, PgTransactionJob, RetryError, RetryInvalidError},
retry::RetryPolicy,
webhook::{HttpMethod, WebhookJobError, WebhookJobMetadata, WebhookJobParameters},
};
Expand Down Expand Up @@ -489,32 +487,27 @@ fn parse_retry_after_header(header_map: &reqwest::header::HeaderMap) -> Option<t
None
}

#[cfg(test)]
mod tests {
use super::*;
use std::time::Duration;
// Note we are ignoring some warnings in this module.
// This is due to a long-standing cargo bug that reports imports and helper functions as unused.
// See: https://github.com/rust-lang/rust/issues/46379.
#[allow(unused_imports)]
use health::HealthRegistry;
#[allow(unused_imports)]
use hook_common::pgqueue::{JobStatus, NewJob};
#[allow(unused_imports)]
use hook_common::pgqueue::{DatabaseError, NewJob};
use sqlx::PgPool;

/// Use process id as a worker id for tests.
#[allow(dead_code)]
fn worker_id() -> String {
std::process::id().to_string()
}

/// Get a request client or panic
#[allow(dead_code)]
fn localhost_client() -> Client {
build_http_client(Duration::from_secs(1), true).expect("failed to create client")
}

#[allow(dead_code)]
async fn enqueue_job(
queue: &PgQueue,
max_attempts: i32,
Expand Down

0 comments on commit ae707cb

Please sign in to comment.