From e9dfb8313181b1772f3d077a813935ad59c16d65 Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Mon, 25 Nov 2024 18:40:12 +0100 Subject: [PATCH] api types: drop unused config type helpers for sync direction Jobs for both sync directions are now stored using the same `sync` config section type, so drop the outdated helpers. Signed-off-by: Christian Ebner Reviewed-by: Dominik Csapak Tested-by: Dominik Csapak --- pbs-api-types/src/jobs.rs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/pbs-api-types/src/jobs.rs b/pbs-api-types/src/jobs.rs index 4a85378c..16b16dd8 100644 --- a/pbs-api-types/src/jobs.rs +++ b/pbs-api-types/src/jobs.rs @@ -519,23 +519,6 @@ impl std::fmt::Display for SyncDirection { } } -impl SyncDirection { - pub fn as_config_type_str(&self) -> &'static str { - match self { - SyncDirection::Pull => "sync", - SyncDirection::Push => "sync-push", - } - } - - pub fn from_config_type_str(config_type: &str) -> Result { - match config_type { - "sync" => Ok(SyncDirection::Pull), - "sync-push" => Ok(SyncDirection::Push), - _ => bail!("invalid config type for sync job"), - } - } -} - pub const RESYNC_CORRUPT_SCHEMA: Schema = BooleanSchema::new("If the verification failed for a local snapshot, try to pull it again.") .schema();