Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
radicle/storage/refs: Remove `RefAt::load`
Lorenz Leutgeb committed 1 month ago
commit 6d771abfcc944683f2dbd9e8e4387f3c332bf238
parent ec36d1c
2 files changed +4 -11
modified crates/radicle-cli/src/commands/inspect.rs
@@ -14,7 +14,7 @@ use radicle::identity::{DocAt, Identity};
use radicle::node::policy::SeedingPolicy;
use radicle::node::AliasStore as _;
use radicle::storage::git::{Repository, Storage};
-
use radicle::storage::refs::{FeatureLevel, RefsAt};
+
use radicle::storage::refs::{FeatureLevel, RefsAt, SignedRefs};
use radicle::storage::{ReadRepository, ReadStorage};

use crate::terminal as term;
@@ -68,7 +68,7 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
            for remote in repo.remote_ids()? {
                let remote = remote?;
                let refs = RefsAt::new(&repo, remote)?;
-
                let sigrefs = refs.load(&repo);
+
                let sigrefs = SignedRefs::load_at(refs.at, remote, &repo);

                println!(
                    "{:<48} {} {}",
modified crates/radicle/src/storage/refs.rs
@@ -330,7 +330,8 @@ impl std::fmt::Display for FeatureLevel {
/// The content-addressable information required to load a remote's
/// `rad/sigrefs`.
///
-
/// Use [`RefsAt::load`] to produce [`SignedRefs`].
+
/// Use [`RefsAt::remote`] and [`RefsAt::at`] with [`SignedRefs::load_at`] to
+
/// attempt loading the expected signed references.
///
/// `RefsAt` can also be used for communicating announcements of updates
/// references to other nodes.
@@ -358,14 +359,6 @@ impl RefsAt {
        Ok(RefsAt { remote, at })
    }

-
    pub fn load<R>(&self, repo: &R) -> Result<Option<SignedRefs>, sigrefs::read::error::Read>
-
    where
-
        R: HasRepoId,
-
        R: sigrefs::git::object::Reader + sigrefs::git::reference::Reader,
-
    {
-
        SignedRefs::load_at(self.at, self.remote, repo)
-
    }
-

    pub fn path(&self) -> &git::fmt::Qualified<'_> {
        &SIGREFS_BRANCH
    }