Function enum_iterator::last
source · pub fn last<T: Sequence>() -> Option<T>
Expand description
Returns the last value of type T
.
Same as Sequence::last
.
Example
use enum_iterator::{last, Sequence};
#[derive(Debug, PartialEq, Sequence)]
enum Day { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }
assert_eq!(last::<Day>(), Some(Day::Sunday));