Skip to content

Commit

Permalink
clippy Avoid redundant_slicing.
Browse files Browse the repository at this point in the history
  • Loading branch information
thatmarkenglishguy committed Sep 6, 2023
1 parent c6dfb2c commit 5cb8623
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/bytes/complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,29 +550,29 @@ mod tests {

assert_eq!(
multi_byte_chars("€ latin", 0, 64),
Ok((&" latin"[..], &"€"[..]))
Ok((" latin", "€"))
);
assert_eq!(
multi_byte_chars("𝄠 latin", 0, 1),
Ok((&" latin"[..], &"𝄠"[..]))
Ok((" latin", "𝄠"))
);
assert_eq!(
multi_byte_chars("باب latin", 0, 64),
Ok((&" latin"[..], &"باب"[..]))
Ok((" latin", "باب"))
);
assert_eq!(
multi_byte_chars("💣💢ᾠ latin", 3, 3),
Ok((&" latin"[..], &"💣💢ᾠ"[..]))
Ok((" latin", "💣💢ᾠ"))
);
assert_eq!(
multi_byte_chars("latin", 0, 64),
Ok((&"latin"[..], &""[..]))
Ok(("latin", ""))
);
assert_eq!(multi_byte_chars("باب", 1, 3), Ok((&""[..], &"باب"[..])));
assert_eq!(multi_byte_chars("باب", 1, 2), Ok((&"ب"[..], &"با"[..])));
assert_eq!(multi_byte_chars("باب", 1, 3), Ok(("", "باب")));
assert_eq!(multi_byte_chars("باب", 1, 2), Ok(("ب", "با")));
assert_eq!(
multi_byte_chars("latin", 1, 64),
Err(Err::Error(Error::new(&"latin"[..], ErrorKind::TakeWhileMN)))
Err(Err::Error(Error::new("latin", ErrorKind::TakeWhileMN)))
);
}
}

0 comments on commit 5cb8623

Please sign in to comment.