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 7bdc6a9

Browse files
authoredMar 19, 2025
Unrolled build for rust-lang#138684
Rollup merge of rust-lang#138684 - bend-n:use_then, r=jhpratt use then in docs for `fuse` to enhance readability use the more-idiomatic `then_some` rather than an `if { some } else { none }` for `fused` docs
2 parents c4b38a5 + 7a8cdf0 commit 7bdc6a9

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.