Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7a8cdf0

Browse files
committedMar 19, 2025
use then
1 parent 75530e9 commit 7a8cdf0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed
 

‎library/core/src/iter/traits/iterator.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1704,11 +1704,7 @@ pub trait Iterator {
17041704
/// self.state = self.state + 1;
17051705
///
17061706
/// // if it's even, Some(i32), else None
1707-
/// if val % 2 == 0 {
1708-
/// Some(val)
1709-
/// } else {
1710-
/// None
1711-
/// }
1707+
/// (val % 2 == 0).then_some(val)
17121708
/// }
17131709
/// }
17141710
///

0 commit comments

Comments
 (0)
Failed to load comments.