[domistream] RTSP framer: collapse the Content-Length header check (clippy collapsible_if); clippy, fmt and doc clean
This commit is contained in:
@@ -287,10 +287,10 @@ impl RtspFramer {
|
|||||||
let mut headers = Vec::new();
|
let mut headers = Vec::new();
|
||||||
for raw in head.split(|&b| b == b'\n').skip(1) {
|
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("");
|
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 let Some((n, v)) = text.split_once(':')
|
||||||
if n.eq_ignore_ascii_case("content-length") {
|
&& n.eq_ignore_ascii_case("content-length")
|
||||||
headers.push((n.to_owned(), v.trim_matches([' ', '\t']).to_owned()));
|
{
|
||||||
}
|
headers.push((n.to_owned(), v.trim_matches([' ', '\t']).to_owned()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(Some((head_len, content_length(&headers, head_len)?)))
|
Ok(Some((head_len, content_length(&headers, head_len)?)))
|
||||||
|
|||||||
Reference in New Issue
Block a user