mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
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:
@@ -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.
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user