Make signing functions generic over the signer trait
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s
Rust / build (macos-latest, stable) (pull_request) Canceled after 0s
Rust / build (ubuntu-latest, stable) (pull_request) Canceled after 0s
Rust / build (windows-latest, stable) (pull_request) Canceled after 0s

This commit is contained in:
2026-10-13 10:41:44 +07:00
parent 3c307691aa
commit 56d3924e46
3 changed files with 19 additions and 12 deletions
+6 -4
View File
@@ -4,7 +4,6 @@ use anyhow::Error;
use nostr::prelude::Url;
use nostr_sdk::prelude::*;
use signed_core::RepoState;
use signed_nostr::UniversalSigner;
/// `ws://` grasp servers, like ngit, use `http(s)://<host>`.
pub(crate) fn grasp_base_url(relay: &RelayUrl) -> Option<String> {
@@ -130,9 +129,9 @@ impl PushOutcome {
}
#[allow(clippy::too_many_arguments)]
pub(crate) async fn push_staged_to_grasps(
pub(crate) async fn push_staged_to_grasps<S>(
client: &Client,
signer: &UniversalSigner,
signer: &S,
repo_id: &str,
refs: &[(String, String)],
head: Option<&str>,
@@ -140,7 +139,10 @@ pub(crate) async fn push_staged_to_grasps(
owner: &str,
servers: &[RelayUrl],
push: impl Fn(&Path, &str, &str, &str) -> Result<(), Error>,
) -> PushOutcome {
) -> PushOutcome
where
S: AsyncGetPublicKey + AsyncSignEvent + ?Sized,
{
let mut outcome = PushOutcome::default();
for relay in servers {