From 9c77c20883f0f7bf3ca477e6f102bd70dd3c2388 Mon Sep 17 00:00:00 2001 From: asonix Date: Thu, 17 Nov 2022 23:55:29 -0600 Subject: [PATCH] clippy --- jobs-core/src/job_info.rs | 6 +++--- jobs-core/src/storage.rs | 12 ++---------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/jobs-core/src/job_info.rs b/jobs-core/src/job_info.rs index 0b86460..80dc658 100644 --- a/jobs-core/src/job_info.rs +++ b/jobs-core/src/job_info.rs @@ -5,7 +5,7 @@ use time::{Duration, OffsetDateTime}; use tracing::trace; use uuid::Uuid; -#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)] /// Information about the sate of an attempted job pub struct ReturnJobInfo { pub(crate) id: Uuid, @@ -35,7 +35,7 @@ impl ReturnJobInfo { } } -#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)] /// Information about a newly created job pub struct NewJobInfo { /// Name of the job @@ -113,7 +113,7 @@ impl NewJobInfo { } } -#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)] /// Metadata pertaining to a job that exists within the background_jobs system /// /// Although exposed publically, this type should only really be handled by the library itself, and diff --git a/jobs-core/src/storage.rs b/jobs-core/src/storage.rs index dd6e358..bb1d4e6 100644 --- a/jobs-core/src/storage.rs +++ b/jobs-core/src/storage.rs @@ -258,11 +258,7 @@ pub mod memory_storage { self.timer.timeout( duration, - inner - .queues - .entry(queue.to_string()) - .or_insert(Event::new()) - .listen(), + inner.queues.entry(queue.to_string()).or_default().listen(), ) }; @@ -275,11 +271,7 @@ pub mod memory_storage { inner.job_queues.insert(id, queue.to_owned()); - inner - .queues - .entry(queue.to_string()) - .or_insert(Event::new()) - .notify(1); + inner.queues.entry(queue.to_string()).or_default().notify(1); Ok(()) }