We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d818a4 commit 4ef6847Copy full SHA for 4ef6847
src/libcore/slice/mod.rs
@@ -2635,3 +2635,11 @@ impl SliceContains for u8 {
2635
memchr::memchr(*self, x).is_some()
2636
}
2637
2638
+
2639
+impl SliceContains for i8 {
2640
+ fn slice_contains(&self, x: &[Self]) -> bool {
2641
+ let byte = *self as u8;
2642
+ let bytes: &[u8] = unsafe { from_raw_parts(x.as_ptr() as *const u8, x.len()) };
2643
+ memchr::memchr(byte, bytes).is_some()
2644
+ }
2645
+}
0 commit comments