Skip to content

Commit 38b368f

Browse files
committed
Clarify that next and previous do not cycle
1 parent ca5ade7 commit 38b368f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

enum-iterator/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub fn reverse_all<T: Sequence>() -> ReverseAll<T> {
115115
ReverseAll(T::last())
116116
}
117117

118-
/// Returns the next value of type `T`.
118+
/// Returns the next value of type `T` or `None` if this was the end.
119119
///
120120
/// # Example
121121
/// ```
@@ -145,7 +145,7 @@ pub fn next_cycle<T: Sequence>(x: &T) -> Option<T> {
145145
next(x).or_else(first)
146146
}
147147

148-
/// Returns the previous value of type `T`.
148+
/// Returns the previous value of type `T` or `None` if this was the beginning.
149149
///
150150
/// # Example
151151
/// ```
@@ -358,7 +358,7 @@ pub trait Sequence: Sized {
358358
/// ```
359359
const CARDINALITY: usize;
360360

361-
/// Returns value following `*self`.
361+
/// Returns value following `*self` or `None` if this was the end.
362362
///
363363
/// # Example
364364
/// ```
@@ -371,7 +371,7 @@ pub trait Sequence: Sized {
371371
/// ```
372372
fn next(&self) -> Option<Self>;
373373

374-
/// Returns value preceding `*self`.
374+
/// Returns value preceding `*self` or `None` if this was the beginning.
375375
///
376376
/// # Example
377377
/// ```

0 commit comments

Comments
 (0)