diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2023-03-09 18:38:03 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2023-03-09 18:38:41 +0300 |
commit | 82f17895898ed2275591d78b3bcb871adbecc495 (patch) | |
tree | 3ca013f89f87799521145a7e9ce2d512126a8f2c /video/closedcaption | |
parent | d3b7928b9912a8383cc7e5095e39c2312d791918 (diff) |
Fix indentation broken by `cargo clippy --fix`
... and another clippy warning.
Diffstat (limited to 'video/closedcaption')
-rw-r--r-- | video/closedcaption/src/mcc_parse/parser.rs | 2 | ||||
-rw-r--r-- | video/closedcaption/src/scc_parse/parser.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/video/closedcaption/src/mcc_parse/parser.rs b/video/closedcaption/src/mcc_parse/parser.rs index 6c847b21b..93acefd82 100644 --- a/video/closedcaption/src/mcc_parse/parser.rs +++ b/video/closedcaption/src/mcc_parse/parser.rs @@ -229,7 +229,7 @@ fn mcc_payload_item(s: &[u8]) -> IResult<&[u8], Either<u8, &'static [u8]>> { map(tag("Z"), |_| Either::Right([0x00].as_ref())), map(take_while_m_n(2, 2, is_hex_digit), |s: &[u8]| { let hex_to_u8 = |v: u8| match v { - v if (b'0'..=b'9').contains(&v) => v - b'0', + v if v.is_ascii_digit() => v - b'0', v if (b'A'..=b'F').contains(&v) => 10 + v - b'A', v if (b'a'..=b'f').contains(&v) => 10 + v - b'a', _ => unreachable!(), diff --git a/video/closedcaption/src/scc_parse/parser.rs b/video/closedcaption/src/scc_parse/parser.rs index 8f2998476..cc0acba94 100644 --- a/video/closedcaption/src/scc_parse/parser.rs +++ b/video/closedcaption/src/scc_parse/parser.rs @@ -69,7 +69,7 @@ fn scc_payload_item(s: &[u8]) -> IResult<&[u8], (u8, u8)> { "invalid SCC payload item", map(take_while_m_n(4, 4, is_hex_digit), |s: &[u8]| { let hex_to_u8 = |v: u8| match v { - v if (b'0'..=b'9').contains(&v) => v - b'0', + v if v.is_ascii_digit() => v - b'0', v if (b'A'..=b'F').contains(&v) => 10 + v - b'A', v if (b'a'..=b'f').contains(&v) => 10 + v - b'a', _ => unreachable!(), |