[domistream] WIP: rustfmt, doc link, clippy fixes (one collapsible-if left in rtsp/mod.rs), PROTOCOL.md status
Paused at Mark's request.
This commit is contained in:
@@ -111,12 +111,8 @@ pub(crate) fn hex_decode(what: &'static str, s: &str) -> Result<Vec<u8>> {
|
||||
return Err(malformed(what));
|
||||
}
|
||||
let mut out = Vec::with_capacity(b.len() / 2);
|
||||
for pair in b.chunks_exact(2) {
|
||||
let (hi, lo) = match pair {
|
||||
[h, l] => (hex_digit(*h), hex_digit(*l)),
|
||||
_ => (None, None),
|
||||
};
|
||||
match (hi, lo) {
|
||||
for [h, l] in b.as_chunks::<2>().0 {
|
||||
match (hex_digit(*h), hex_digit(*l)) {
|
||||
(Some(h), Some(l)) => out.push((h << 4) | l),
|
||||
_ => return Err(malformed(what)),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user