pub trait SliceExt<T> {
// Required method
fn chunks_exact_or_repeat(
&self,
chunk_size: usize,
) -> Either<ChunksExact<'_, T>, Repeat<&[T]>>;
}Expand description
Extention trait for slices.
Required Methods§
Sourcefn chunks_exact_or_repeat(
&self,
chunk_size: usize,
) -> Either<ChunksExact<'_, T>, Repeat<&[T]>>
fn chunks_exact_or_repeat( &self, chunk_size: usize, ) -> Either<ChunksExact<'_, T>, Repeat<&[T]>>
Same as chunks_exact but we allow the chunk_size to be zero when the slice is empty.