konst_kernel/iter/
iter_adaptors.rsuse crate::into_iter::{ConstIntoIter, IsIteratorKind};
pub const fn repeat<T: Copy>(val: T) -> Repeat<T> {
Repeat(val)
}
pub struct Repeat<T>(T);
impl<T> ConstIntoIter for Repeat<T> {
type Kind = IsIteratorKind;
type IntoIter = Self;
type Item = T;
}
impl<T: Copy> Repeat<T> {
pub const fn next(self) -> Option<(T, Self)> {
Some((self.0, self))
}
pub const fn next_back(self) -> Option<(T, Self)> {
Some((self.0, self))
}
pub const fn rev(self) -> Self {
self
}
pub const fn copy(&self) -> Self {
Self(self.0)
}
}