From 7a8cdf00e64fb35756cb2d3509fc254cc3529143 Mon Sep 17 00:00:00 2001 From: bendn Date: Wed, 19 Mar 2025 10:45:42 +0700 Subject: [PATCH] use then --- library/core/src/iter/traits/iterator.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index 075da022854..3bbb52fdbcb 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -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) /// } /// } ///