This crate provides the Single
trait for extracting the element from a single-element iterator.
You may use this crate under the MIT license or the Apache License 2.0 at your discretion.
rust
pub trait Single: Iterator {
fn single(self) -> Result<Self::Item, Error>;
}
fn single(self) -> Result<Self::Item, Error>
Get the single element from a single-element iterator.
rust
impl<I: Iterator> Single for I {}