From f75e1c59aacf5ce668fd327e4e3d827511661c2a Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 8 Jan 2026 00:50:54 +0000 Subject: chore: cargo fmt --- src/nostr/builder.rs | 9 +++++++-- src/nostr/policy/pr_event.rs | 1 - src/nostr/policy/state.rs | 10 ++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) (limited to 'src/nostr') diff --git a/src/nostr/builder.rs b/src/nostr/builder.rs index 0e5c18a..81f7fbb 100644 --- a/src/nostr/builder.rs +++ b/src/nostr/builder.rs @@ -162,7 +162,11 @@ impl Nip34WritePolicy { match self.state_policy.validate(event) { StateResult::Accept => { // Process state alignment asynchronously - match self.state_policy.process_state_event(event, is_synced).await { + match self + .state_policy + .process_state_event(event, is_synced) + .await + { Ok(poilicy_result) => poilicy_result, Err(e) => { tracing::warn!("Failed to process state event {}: {}", event_id_str, e); @@ -247,7 +251,8 @@ impl Nip34WritePolicy { ); return WritePolicyResult::Reject { status: false, - message: "invalid: previously expired from purgatory without git data".into(), + message: "invalid: previously expired from purgatory without git data" + .into(), }; } diff --git a/src/nostr/policy/pr_event.rs b/src/nostr/policy/pr_event.rs index 9942a6a..00e09c3 100644 --- a/src/nostr/policy/pr_event.rs +++ b/src/nostr/policy/pr_event.rs @@ -237,5 +237,4 @@ impl PrEventPolicy { Ok(repo_paths) } - } diff --git a/src/nostr/policy/state.rs b/src/nostr/policy/state.rs index 7bbb379..acb76a3 100644 --- a/src/nostr/policy/state.rs +++ b/src/nostr/policy/state.rs @@ -9,8 +9,8 @@ use nostr_relay_builder::builder::WritePolicyResult; use nostr_relay_builder::prelude::Event; use super::PolicyContext; -use crate::git::authorization::fetch_repository_data; use crate::git; +use crate::git::authorization::fetch_repository_data; use crate::nostr::events::{validate_state, RepositoryAnnouncement, RepositoryState}; /// Result of state policy evaluation @@ -48,7 +48,11 @@ impl StatePolicy { /// * `is_synced` - True if this event came from proactive sync (vs user-submitted) /// /// Returns the true if git data already availale or false if added to purgatory - pub async fn process_state_event(&self, event: &Event, is_synced: bool) -> Result { + pub async fn process_state_event( + &self, + event: &Event, + is_synced: bool, + ) -> Result { // Parse state to get HEAD and branch info let state = RepositoryState::from_event(event.clone()).context("Failed to parse state event")?; @@ -155,8 +159,6 @@ impl StatePolicy { }) } } - - } fn find_repo_with_git_data( -- cgit v1.2.3