[pbs-devel] [PATCH proxmox-backup 4/4] api types: drop unused config type helpers for sync direction

Christian Ebner c.ebner at proxmox.com
Mon Nov 25 18:40:12 CET 2024


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 <c.ebner at proxmox.com>
---
 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 4a85378ce..16b16dd84 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<Self, anyhow::Error> {
-        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();
-- 
2.39.5





More information about the pbs-devel mailing list