👎Deprecated since 1.0.1: use
Itertools::at_most_one
insteadExpand description
THIS CRATE IS DEPRECATED. Use Itertools::at_most_one
instead.
Provides the Single
trait for extracting the element from a
single-element iterator.
§Examples
use single::{ Single, Error };
use std::iter;
assert_eq!(iter::empty::<i32>().single(), Err(Error::NoElements));
assert_eq!(iter::once(0).single(), Ok(0));
assert_eq!(iter::repeat(0).single(), Err(Error::MultipleElements));
Enums§
- Error
Deprecated - An error in the execution of
Single::single
.
Traits§
- Single
Deprecated