[domistream] RTSP framer: collapse the Content-Length header check (clippy collapsible_if); clippy, fmt and doc clean

This commit is contained in:
2026-11-26 03:12:17 +01:00
parent bd91a1007e
commit 61296102d1
+4 -4
View File
@@ -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)?)))