diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-11 16:53:03 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-11 16:53:03 +0000 |
| commit | 2a9160836bb87fdea3ae891563b0169c68d1c2ab (patch) | |
| tree | 583c890687beaf7f380fc0be131bdf17485f06fa /src/nostr/policy/announcement.rs | |
| parent | 52489d3b1a7d79e164b4cc901b53fd06c05ce1b1 (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/announcement.rs')
| -rw-r--r-- | src/nostr/policy/announcement.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nostr/policy/announcement.rs b/src/nostr/policy/announcement.rs index 8d30baf..353738b 100644 --- a/src/nostr/policy/announcement.rs +++ b/src/nostr/policy/announcement.rs | |||
| @@ -72,7 +72,10 @@ impl AnnouncementPolicy { | |||
| 72 | 72 | ||
| 73 | /// Create a bare git repository if it doesn't exist | 73 | /// Create a bare git repository if it doesn't exist |
| 74 | /// Path format: <git_data_path>/<npub>/<identifier>.git | 74 | /// Path format: <git_data_path>/<npub>/<identifier>.git |
| 75 | pub fn ensure_bare_repository(&self, announcement: &RepositoryAnnouncement) -> Result<(), String> { | 75 | pub fn ensure_bare_repository( |
| 76 | &self, | ||
| 77 | announcement: &RepositoryAnnouncement, | ||
| 78 | ) -> Result<(), String> { | ||
| 76 | let repo_path = self.ctx.git_data_path.join(announcement.repo_path()); | 79 | let repo_path = self.ctx.git_data_path.join(announcement.repo_path()); |
| 77 | 80 | ||
| 78 | // Check if repository already exists | 81 | // Check if repository already exists |
| @@ -154,4 +157,4 @@ impl AnnouncementPolicy { | |||
| 154 | 157 | ||
| 155 | Ok(false) | 158 | Ok(false) |
| 156 | } | 159 | } |
| 157 | } \ No newline at end of file | 160 | } |