From 61296102d1d2e8d3cae7f4b4f8144b20c4d27e4c Mon Sep 17 00:00:00 2001 From: mnovak Date: Thu, 26 Nov 2026 03:12:17 +0100 Subject: [PATCH] [domistream] RTSP framer: collapse the Content-Length header check (clippy collapsible_if); clippy, fmt and doc clean --- crates/domistream/src/rtsp/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/domistream/src/rtsp/mod.rs b/crates/domistream/src/rtsp/mod.rs index 81e59aa..241bd29 100644 --- a/crates/domistream/src/rtsp/mod.rs +++ b/crates/domistream/src/rtsp/mod.rs @@ -287,10 +287,10 @@ impl RtspFramer { let mut headers = Vec::new(); for raw in head.split(|&b| b == b'\n').skip(1) { let text = core::str::from_utf8(raw.strip_suffix(b"\r").unwrap_or(raw)).unwrap_or(""); - if let Some((n, v)) = text.split_once(':') { - if n.eq_ignore_ascii_case("content-length") { - headers.push((n.to_owned(), v.trim_matches([' ', '\t']).to_owned())); - } + if let Some((n, v)) = text.split_once(':') + && n.eq_ignore_ascii_case("content-length") + { + headers.push((n.to_owned(), v.trim_matches([' ', '\t']).to_owned())); } } Ok(Some((head_len, content_length(&headers, head_len)?)))