upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/nostr/policy/related.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-11 16:53:03 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-11 16:53:03 +0000
commit2a9160836bb87fdea3ae891563b0169c68d1c2ab (patch)
tree583c890687beaf7f380fc0be131bdf17485f06fa /src/nostr/policy/related.rs
parent52489d3b1a7d79e164b4cc901b53fd06c05ce1b1 (diff)
fix: resolve all fmt and clippy warnings
Main lib (src/): - Add #[allow(dead_code)] for build_info field (stored to prevent Prometheus unregistration) - Add #[allow(dead_code)] for first_seen field (reserved for future rate limiting) - Replace .or_insert_with(RelaySyncNeeds::default) with .or_default() - Replace manual div_ceil implementations with .div_ceil(100) Test code (tests/): - Replace .expect(&format!(...)) with .unwrap_or_else(|_| panic!(...)) - Remove needless borrows in fetch_metrics() calls - Add #[allow(dead_code)] and #[allow(unused_imports)] to test helpers module grasp-audit: - Apply cargo fmt to fix formatting
Diffstat (limited to 'src/nostr/policy/related.rs')
-rw-r--r--src/nostr/policy/related.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/nostr/policy/related.rs b/src/nostr/policy/related.rs
index 1937ca7..7ce87db 100644
--- a/src/nostr/policy/related.rs
+++ b/src/nostr/policy/related.rs
@@ -169,10 +169,7 @@ impl RelatedEventPolicy {
169 169
170 /// Check if any events exist in database 170 /// Check if any events exist in database
171 /// Returns the first matching event ID found, or None if none match 171 /// Returns the first matching event ID found, or None if none match
172 async fn find_accepted_event( 172 async fn find_accepted_event(&self, event_ids: &[EventId]) -> Result<Option<EventId>, String> {
173 &self,
174 event_ids: &[EventId],
175 ) -> Result<Option<EventId>, String> {
176 if event_ids.is_empty() { 173 if event_ids.is_empty() {
177 return Ok(None); 174 return Ok(None);
178 } 175 }
@@ -273,4 +270,4 @@ impl RelatedEventPolicy {
273 270
274 Ok(false) 271 Ok(false)
275 } 272 }
276} \ No newline at end of file 273}