Skip to content

Commit

Permalink
chore: fix clippy warnings (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrat555 authored Mar 18, 2023
1 parent 95a12b4 commit 1d0def0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions src/asynk/async_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ const RETRY_TASK_QUERY: &str = include_str!("queries/retry_task.sql");

pub const DEFAULT_TASK_TYPE: &str = "common";

#[derive(Debug, Eq, PartialEq, Clone, ToSql, FromSql)]
#[derive(Debug, Eq, PartialEq, Clone, ToSql, FromSql, Default)]
#[postgres(name = "fang_task_state")]
pub enum FangTaskState {
#[postgres(name = "new")]
#[default]
New,
#[postgres(name = "in_progress")]
InProgress,
Expand All @@ -55,12 +56,6 @@ pub enum FangTaskState {
Retried,
}

impl Default for FangTaskState {
fn default() -> Self {
FangTaskState::New
}
}

#[derive(TypedBuilder, Debug, Eq, PartialEq, Clone)]
pub struct Task {
#[builder(setter(into))]
Expand Down
9 changes: 2 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,17 @@ pub enum CronError {
/// All possible options for retaining tasks in the db after their execution.
///
/// The default mode is [`RetentionMode::RemoveAll`]
#[derive(Clone, Debug)]
#[derive(Clone, Debug, Default)]
pub enum RetentionMode {
/// Keep all tasks
KeepAll,
/// Remove all tasks
#[default]
RemoveAll,
/// Remove only successfully finished tasks
RemoveFinished,
}

impl Default for RetentionMode {
fn default() -> Self {
RetentionMode::RemoveAll
}
}

/// Configuration parameters for putting workers to sleep
/// while they don't have any tasks to execute
#[derive(Clone, Debug, TypedBuilder)]
Expand Down

0 comments on commit 1d0def0

Please sign in to comment.