From 82f17895898ed2275591d78b3bcb871adbecc495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 9 Mar 2023 17:38:03 +0200 Subject: [PATCH] Fix indentation broken by `cargo clippy --fix` ... and another clippy warning. --- generic/file/src/filesink/imp.rs | 7 ++++--- generic/file/src/filesrc/imp.rs | 7 ++++--- video/closedcaption/src/mcc_parse/parser.rs | 2 +- video/closedcaption/src/scc_parse/parser.rs | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/generic/file/src/filesink/imp.rs b/generic/file/src/filesink/imp.rs index 6e9b7773..64ebc5c4 100644 --- a/generic/file/src/filesink/imp.rs +++ b/generic/file/src/filesink/imp.rs @@ -42,11 +42,12 @@ impl Default for Settings { enum State { #[default] Stopped, - Started { file: File, position: u64 }, + Started { + file: File, + position: u64, + }, } - - #[derive(Default)] pub struct FileSink { settings: Mutex, diff --git a/generic/file/src/filesrc/imp.rs b/generic/file/src/filesrc/imp.rs index a5da83fb..137a2de5 100644 --- a/generic/file/src/filesrc/imp.rs +++ b/generic/file/src/filesrc/imp.rs @@ -42,11 +42,12 @@ impl Default for Settings { enum State { #[default] Stopped, - Started { file: File, position: u64 }, + Started { + file: File, + position: u64, + }, } - - #[derive(Default)] pub struct FileSrc { settings: Mutex, diff --git a/video/closedcaption/src/mcc_parse/parser.rs b/video/closedcaption/src/mcc_parse/parser.rs index 6c847b21..93acefd8 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> { 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 8f299847..cc0acba9 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!(),