Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Oct 21, 2023
1 parent 95435e8 commit 2973542
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 26 deletions.
20 changes: 4 additions & 16 deletions src/bytes/complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
7 changes: 2 additions & 5 deletions src/character/complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
Expand Down Expand Up @@ -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)));
Expand Down
5 changes: 1 addition & 4 deletions src/character/streaming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
2 changes: 1 addition & 1 deletion src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2973542

Please sign in to comment.