mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-16 05:56:56 +00:00
Rollup merge of #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
This commit is contained in:
commit
3b7faca09c
@ -1704,11 +1704,7 @@ pub trait Iterator {
|
||||
/// self.state = self.state + 1;
|
||||
///
|
||||
/// // if it's even, Some(i32), else None
|
||||
/// if val % 2 == 0 {
|
||||
/// Some(val)
|
||||
/// } else {
|
||||
/// None
|
||||
/// }
|
||||
/// (val % 2 == 0).then_some(val)
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user