Skip to content

Commit d475a76

Browse files
committed
Use then_some in try_join
1 parent dbd9a0b commit d475a76

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

clippy_utils/src/ty/type_certainty/certainty.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ impl Meet for Option<DefId> {
4141
impl TryJoin for Option<DefId> {
4242
fn try_join(self, other: Self) -> Option<Self> {
4343
match (self, other) {
44-
(Some(lhs), Some(rhs)) => {
45-
if lhs == rhs {
46-
Some(Some(lhs))
47-
} else {
48-
None
49-
}
50-
},
44+
(Some(lhs), Some(rhs)) => (lhs == rhs).then_some(Some(lhs)),
5145
(Some(def_id), _) | (_, Some(def_id)) => Some(Some(def_id)),
5246
(None, None) => Some(None),
5347
}

0 commit comments

Comments
 (0)