From 29735424d9fa94c0087acd0845a66750630ee55b Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Sat, 21 Oct 2023 14:37:29 +0200 Subject: [PATCH] fmt --- src/bytes/complete.rs | 20 ++++---------------- src/character/complete.rs | 7 ++----- src/character/streaming.rs | 5 +---- src/traits.rs | 2 +- 4 files changed, 8 insertions(+), 26 deletions(-) diff --git a/src/bytes/complete.rs b/src/bytes/complete.rs index b40cf975a..a53b2dd64 100644 --- a/src/bytes/complete.rs +++ b/src/bytes/complete.rs @@ -548,26 +548,14 @@ mod tests { take_while_m_n(m, n, |c: char| c.len() > 1)(s) } - assert_eq!( - multi_byte_chars("€ latin", 0, 64), - Ok((" latin", "€")) - ); - assert_eq!( - multi_byte_chars("𝄠 latin", 0, 1), - Ok((" latin", "𝄠")) - ); - assert_eq!( - multi_byte_chars("باب latin", 0, 64), - Ok((" latin", "باب")) - ); + assert_eq!(multi_byte_chars("€ latin", 0, 64), Ok((" latin", "€"))); + assert_eq!(multi_byte_chars("𝄠 latin", 0, 1), Ok((" latin", "𝄠"))); + assert_eq!(multi_byte_chars("باب latin", 0, 64), Ok((" latin", "باب"))); assert_eq!( multi_byte_chars("💣💢ᾠ latin", 3, 3), Ok((" latin", "💣💢ᾠ")) ); - assert_eq!( - multi_byte_chars("latin", 0, 64), - Ok(("latin", "")) - ); + assert_eq!(multi_byte_chars("latin", 0, 64), Ok(("latin", ""))); assert_eq!(multi_byte_chars("باب", 1, 3), Ok(("", "باب"))); assert_eq!(multi_byte_chars("باب", 1, 2), Ok(("ب", "با"))); assert_eq!( diff --git a/src/character/complete.rs b/src/character/complete.rs index d8045c9f2..17b5eb29f 100644 --- a/src/character/complete.rs +++ b/src/character/complete.rs @@ -916,7 +916,7 @@ mod tests { assert_eq!(oct_digit1(d), Err(Err::Error((d, ErrorKind::OctDigit)))); assert_eq!(bin_digit1(a), Err(Err::Error((a, ErrorKind::BinDigit)))); assert_eq!( - bin_digit1::<_, (_, ErrorKind)>(b), + bin_digit1::<_, (_, ErrorKind)>(b), Ok((&b"234"[..], &b"1"[..])) ); assert_eq!(bin_digit1(c), Err(Err::Error((c, ErrorKind::BinDigit)))); @@ -959,10 +959,7 @@ mod tests { assert_eq!(oct_digit1(c), Err(Err::Error((c, ErrorKind::OctDigit)))); assert_eq!(oct_digit1(d), Err(Err::Error((d, ErrorKind::OctDigit)))); assert_eq!(bin_digit1(a), Err(Err::Error((a, ErrorKind::BinDigit)))); - assert_eq!( - bin_digit1::<_, (_, ErrorKind)>(b), - Ok(("234", "1")) - ); + assert_eq!(bin_digit1::<_, (_, ErrorKind)>(b), Ok(("234", "1"))); assert_eq!(bin_digit1(c), Err(Err::Error((c, ErrorKind::BinDigit)))); assert_eq!(bin_digit1(d), Err(Err::Error((d, ErrorKind::BinDigit)))); assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(a), Ok((empty, a))); diff --git a/src/character/streaming.rs b/src/character/streaming.rs index a3d03e229..55eab4271 100644 --- a/src/character/streaming.rs +++ b/src/character/streaming.rs @@ -908,10 +908,7 @@ mod tests { assert_eq!(oct_digit1(c), Err(Err::Error((c, ErrorKind::OctDigit)))); assert_eq!(oct_digit1(d), Err(Err::Error((d, ErrorKind::OctDigit)))); assert_eq!(bin_digit1(a), Err(Err::Error((a, ErrorKind::BinDigit)))); - assert_eq!( - bin_digit1::<_, (_, ErrorKind)>(b), - Ok(("234", "1")) - ); + assert_eq!(bin_digit1::<_, (_, ErrorKind)>(b), Ok(("234", "1"))); assert_eq!(bin_digit1(c), Err(Err::Error((c, ErrorKind::BinDigit)))); assert_eq!(bin_digit1(d), Err(Err::Error((d, ErrorKind::BinDigit)))); assert_eq!( diff --git a/src/traits.rs b/src/traits.rs index 3d8e199f7..a7fe99a6f 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -726,7 +726,7 @@ impl AsChar for u8 { } #[inline] fn is_bin_digit(self) -> bool { - matches!(self, 0x30..=0x31) + matches!(self, 0x30..=0x31) } #[inline] fn len(self) -> usize {