#![doc = include_str!("../README.md")]
#![deny(missing_docs)]
#![deny(rustdoc::broken_intra_doc_links)]
#![deny(rustdoc::invalid_rust_codeblocks)]
#![deny(rustdoc::missing_crate_level_docs)]
#![warn(rustdoc::invalid_codeblock_attributes)]
mod alternating;
mod alternating_all;
mod alternating_no_remainder;
mod utils;
pub use alternating::Alternating;
pub use alternating_all::AlternatingAll;
pub use alternating_no_remainder::AlternatingNoRemainder;
pub trait AlternatingExt: Iterator {
fn alternate_with<I>(self, other: I) -> Alternating<Self, I::IntoIter>
where
Self: Sized,
I: IntoIterator<Item = Self::Item>,
{
Alternating::new(self, other)
}
fn alternate_with_all<I>(self, other: I) -> AlternatingAll<Self, I::IntoIter>
where
Self: Sized,
I: IntoIterator<Item = Self::Item>,
{
AlternatingAll::new(self, other)
}
fn alternate_with_no_remainder<I>(self, other: I) -> AlternatingNoRemainder<Self, I::IntoIter>
where
Self: Sized,
I: IntoIterator<Item = Self::Item>,
{
AlternatingNoRemainder::new(self, other)
}
}
impl<I> AlternatingExt for I where I: Iterator {}