diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-01 14:31:32 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-01 15:22:38 +0000 |
| commit | d2ac69816567f092fe0d4661723bc43778cb481b (patch) | |
| tree | e8b51b61a6a7b0ab1a214adebe4e237143b01f0b /src/nostr/events.rs | |
| parent | 7a78815e29b01c83f3d0ec195ba717a2eba8cd37 (diff) | |
fix cargo clippy and fmt warnings
Diffstat (limited to 'src/nostr/events.rs')
| -rw-r--r-- | src/nostr/events.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nostr/events.rs b/src/nostr/events.rs index 6a62ccd..050bfdd 100644 --- a/src/nostr/events.rs +++ b/src/nostr/events.rs | |||
| @@ -322,9 +322,9 @@ impl RepositoryState { | |||
| 322 | 322 | ||
| 323 | /// Get the HEAD branch name (without refs/heads/ prefix) | 323 | /// Get the HEAD branch name (without refs/heads/ prefix) |
| 324 | pub fn get_head_branch(&self) -> Option<&str> { | 324 | pub fn get_head_branch(&self) -> Option<&str> { |
| 325 | self.head.as_ref().and_then(|h| { | 325 | self.head |
| 326 | h.strip_prefix("refs/heads/") | 326 | .as_ref() |
| 327 | }) | 327 | .and_then(|h| h.strip_prefix("refs/heads/")) |
| 328 | } | 328 | } |
| 329 | 329 | ||
| 330 | /// Check if the HEAD commit is available in the git repository | 330 | /// Check if the HEAD commit is available in the git repository |
| @@ -397,7 +397,7 @@ pub fn validate_state(event: &Event) -> Result<()> { | |||
| 397 | #[cfg(test)] | 397 | #[cfg(test)] |
| 398 | mod tests { | 398 | mod tests { |
| 399 | use super::*; | 399 | use super::*; |
| 400 | use nostr_sdk::{EventBuilder, Keys, Tag}; | 400 | use nostr_sdk::{EventBuilder, Keys}; |
| 401 | 401 | ||
| 402 | fn create_test_keys() -> Keys { | 402 | fn create_test_keys() -> Keys { |
| 403 | Keys::generate() | 403 | Keys::generate() |
| @@ -618,7 +618,10 @@ mod tests { | |||
| 618 | 618 | ||
| 619 | let announcement = RepositoryAnnouncement::from_event(event).unwrap(); | 619 | let announcement = RepositoryAnnouncement::from_event(event).unwrap(); |
| 620 | assert_eq!(announcement.maintainers.len(), 1); | 620 | assert_eq!(announcement.maintainers.len(), 1); |
| 621 | assert_eq!(announcement.maintainers[0], maintainer_keys.public_key().to_hex()); | 621 | assert_eq!( |
| 622 | announcement.maintainers[0], | ||
| 623 | maintainer_keys.public_key().to_hex() | ||
| 624 | ); | ||
| 622 | } | 625 | } |
| 623 | 626 | ||
| 624 | #[test] | 627 | #[test] |
| @@ -727,10 +730,7 @@ mod tests { | |||
| 727 | 730 | ||
| 728 | let keys = create_test_keys(); | 731 | let keys = create_test_keys(); |
| 729 | let tags = vec![ | 732 | let tags = vec![ |
| 730 | Tag::custom( | 733 | Tag::custom(nostr_sdk::TagKind::d(), vec!["test-repo".to_string()]), |
| 731 | nostr_sdk::TagKind::d(), | ||
| 732 | vec!["test-repo".to_string()], | ||
| 733 | ), | ||
| 734 | Tag::custom( | 734 | Tag::custom( |
| 735 | nostr_sdk::TagKind::Custom("refs/heads/main".into()), | 735 | nostr_sdk::TagKind::Custom("refs/heads/main".into()), |
| 736 | vec!["a1b2c3d4".to_string()], | 736 | vec!["a1b2c3d4".to_string()], |