Function konst::slice::bytes_contain
source · pub const fn bytes_contain<const N: usize, P>(left: &[u8], pattern: &P) -> boolwhere
P: ?Sized + BytesPattern<N>,
Expand description
Whether pattern
is inside left
.
§Example
use konst::slice::bytes_contain;
assert!(bytes_contain(b"foo-bar", b"foo"));
assert!(bytes_contain(b"bar-foo", "foo"));
assert!(!bytes_contain(b"foo-bar-baz", &'q'));