Which mirrors the default implementation for slices in the standard library. But std’s implementation also is able to use specialization to create an explicit call to memcmp for primitives types such as u8, i8, u16, i16, u32, i32, u64, i64, u128, i128, usize, isize, char, bool. So probably the better simplification is to just write a == b even in a dedicated slice_eq function.