Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
stephaneyfx committed Feb 25, 2024
1 parent 8efd9c9 commit 7eab7e3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions enum-iterator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ pub fn next<T: Sequence>(x: &T) -> Option<T> {
/// assert_eq!(next_cycle(&Day::Sunday), Day::Monday);
/// ```
pub fn next_cycle<T: Sequence>(x: &T) -> T {
next(x).or_else(first).expect("Sequence::first returned None for inhabited type")
next(x)
.or_else(first)
.expect("Sequence::first returned None for inhabited type")
}

/// Returns the previous value of type `T` or `None` if this was the beginning.
Expand Down Expand Up @@ -183,7 +185,9 @@ pub fn previous<T: Sequence>(x: &T) -> Option<T> {
/// assert_eq!(previous_cycle(&Day::Monday), Day::Sunday);
/// ```
pub fn previous_cycle<T: Sequence>(x: &T) -> T {
previous(x).or_else(last).expect("Sequence::last returned None for inhabited type")
previous(x)
.or_else(last)
.expect("Sequence::last returned None for inhabited type")
}

/// Returns the first value of type `T`.
Expand Down

0 comments on commit 7eab7e3

Please sign in to comment.