Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
fetch: Remove dead code from `DataRefs`
Lorenz Leutgeb committed 1 month ago
commit 363a7231e5206e8ef0a7e947a02c852f10a86d8b
parent 725ced0
2 files changed +8 -14
modified crates/radicle-fetch/src/stage.rs
@@ -477,19 +477,17 @@ impl ProtocolStage for SigrefsAt {
/// any that were found to exist before the latest fetch.
#[derive(Debug)]
pub struct DataRefs {
-
    /// The node that is being fetched from.
-
    #[allow(dead_code)]
-
    pub remote: PublicKey,
    /// The set of signed references from each remote that was
    /// fetched.
-
    pub remotes: RemoteRefs,
-
    /// The data limit for this stage of fetching.
-
    #[allow(dead_code)]
-
    pub limit: u64,
+
    remotes: RemoteRefs,
}

impl DataRefs {
-
    pub(crate) fn into_remote_refs(self) -> RemoteRefs {
+
    pub(crate) fn new(remotes: RemoteRefs) -> Self {
+
        Self { remotes }
+
    }
+

+
    pub(crate) fn into_inner(self) -> RemoteRefs {
        self.remotes
    }
}
modified crates/radicle-fetch/src/state.rs
@@ -425,11 +425,7 @@ impl FetchState {
            start.elapsed().as_millis()
        );

-
        let data_refs = stage::DataRefs {
-
            remote,
-
            remotes: signed_refs,
-
            limit: limit.refs,
-
        };
+
        let data_refs = stage::DataRefs::new(signed_refs);
        let fetched = self.run_stage(handle, handshake, &data_refs)?;
        log::debug!(
            "Fetched data refs for {} remotes ({}ms)",
@@ -452,7 +448,7 @@ impl FetchState {
        // repository.
        let mut failures = sigrefs::Validations::default();

-
        let signed_refs = data_refs.into_remote_refs();
+
        let signed_refs = data_refs.into_inner();

        // We may prune fetched remotes, so we keep track of
        // non-pruned, fetched remotes here.