fix: resolve pre-existing clippy collapsible_match warnings

Collapse nested if blocks into match guard patterns in messages.rs
and ingest.rs to satisfy clippy::collapsible_match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wes
2026-04-21 15:33:00 -07:00
co-authored by Claude Opus 4.6
parent d40c918f09
commit 02cbc39fa4
2 changed files with 8 additions and 12 deletions
+4 -4
View File
@@ -129,11 +129,11 @@ pub fn validate_imeta_tags(tags: &[Vec<String>], media_base_url: &str) -> Result
return Err("imeta duration must be a valid float".into());
}
}
"bitrate" => {
"bitrate"
// NIP-71 standard field: bits/sec as integer, positive
if value.parse::<u64>().map_or(true, |b| b == 0) {
return Err("imeta bitrate must be a positive integer".into());
}
if value.parse::<u64>().map_or(true, |b| b == 0) =>
{
return Err("imeta bitrate must be a positive integer".into());
}
"image" => {
// NIP-71 poster frame — must be a local media URL with an image extension.
+4 -8
View File
@@ -727,15 +727,11 @@ fn validate_diff_event(event: &Event) -> Result<(), String> {
return Err("parent-commit SHA must be at least 7 hex characters".to_string());
}
}
"branch" => {
if parts.len() < 3 || parts[1].is_empty() || parts[2].is_empty() {
return Err("branch tag requires both source and target".to_string());
}
"branch" if (parts.len() < 3 || parts[1].is_empty() || parts[2].is_empty()) => {
return Err("branch tag requires both source and target".to_string());
}
"pr" => {
if parts[1].parse::<u32>().map(|n| n == 0).unwrap_or(true) {
return Err("pr number must be a positive integer".to_string());
}
"pr" if parts[1].parse::<u32>().map(|n| n == 0).unwrap_or(true) => {
return Err("pr number must be a positive integer".to_string());
}
_ => {}
}