Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: Also use a default for max. replicas
◌ CI pending Lorenz Leutgeb committed 6 months ago
commit 61b058a294d71fa8c291ea1ff16038f369fccbaa
parent cfd16b816b2ea7c9d85315b4d4c7a5f19806c3cc
1 pending (1 total) View logs
1 file changed +3 -5
modified crates/radicle-cli/src/commands/sync/args.rs
@@ -123,8 +123,9 @@ pub(super) struct SyncArgs {
        value_name = "COUNT",
        value_parser = replicas_non_zero,
        conflicts_with = "inventory",
+
        default_value_t = radicle::node::sync::DEFAULT_REPLICATION_FACTOR,
    )]
-
    max_replicas: Option<usize>,
+
    max_replicas: usize,

    /// Enable announcing inventory [default: false]
    ///
@@ -150,10 +151,7 @@ impl SyncArgs {
    }

    fn replication(&self) -> sync::ReplicationFactor {
-
        match (self.replicas, self.max_replicas) {
-
            (min, None) => sync::ReplicationFactor::must_reach(min),
-
            (min, Some(max)) => sync::ReplicationFactor::range(min, max),
-
        }
+
        sync::ReplicationFactor::range(self.replicas, self.max_replicas)
    }
}