run_git/util.rs
1/// Does the same for bytes that `haystack.contains(needle)` does for
2/// strings. (This will be in std in the future:
3/// <https://github.com/rust-lang/rust/issues/134149>)
4pub fn contains_bytes(haystack: &[u8], needle: &[u8]) -> bool {
5 haystack
6 .windows(needle.len())
7 .any(|window| window == needle)
8}