diff --git a/crates/sprout-relay/src/api/messages.rs b/crates/sprout-relay/src/api/messages.rs index ef80c0d80..80917442b 100644 --- a/crates/sprout-relay/src/api/messages.rs +++ b/crates/sprout-relay/src/api/messages.rs @@ -129,11 +129,11 @@ pub fn validate_imeta_tags(tags: &[Vec], 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::().map_or(true, |b| b == 0) { - return Err("imeta bitrate must be a positive integer".into()); - } + if value.parse::().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. diff --git a/crates/sprout-relay/src/handlers/ingest.rs b/crates/sprout-relay/src/handlers/ingest.rs index 901a6bfa0..0d7824643 100644 --- a/crates/sprout-relay/src/handlers/ingest.rs +++ b/crates/sprout-relay/src/handlers/ingest.rs @@ -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::().map(|n| n == 0).unwrap_or(true) { - return Err("pr number must be a positive integer".to_string()); - } + "pr" if parts[1].parse::().map(|n| n == 0).unwrap_or(true) => { + return Err("pr number must be a positive integer".to_string()); } _ => {} }