add brackets to match for clippy

This commit is contained in:
Noa Aarts 2024-12-29 11:32:25 +01:00
parent 4f1a28acf8
commit 5e5a29b3a1
Signed by: noa
GPG key ID: 1850932741EFF672

View file

@ -25,12 +25,12 @@ fn parse_coordinate(string: &str) -> io::Result<Coordinate> {
type HexChar = u8; type HexChar = u8;
fn val(c1: u8, c2: u8) -> io::Result<HexChar> { fn val(c1: u8, c2: u8) -> io::Result<HexChar> {
Ok((match c1 { Ok(((match c1 {
b'A'..=b'F' => c1 - b'A' + 10, b'A'..=b'F' => c1 - b'A' + 10,
b'a'..=b'f' => c1 - b'a' + 10, b'a'..=b'f' => c1 - b'a' + 10,
b'0'..=b'9' => c1 - b'0', b'0'..=b'9' => c1 - b'0',
_ => return Err(Error::from(ErrorKind::InvalidInput)), _ => return Err(Error::from(ErrorKind::InvalidInput)),
}) << 4 }) << 4)
| (match c2 { | (match c2 {
b'A'..=b'F' => c2 - b'A' + 10, b'A'..=b'F' => c2 - b'A' + 10,
b'a'..=b'f' => c2 - b'a' + 10, b'a'..=b'f' => c2 - b'a' + 10,