fetch: Remove dead code from `DataRefs`

This commit is contained in:
Lorenz Leutgeb 2026-03-17 15:43:41 +01:00
parent 725ced09d5
commit 363a7231e5
No known key found for this signature in database
2 changed files with 8 additions and 14 deletions

View File

@ -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
}
}

View File

@ -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.