diff --git a/clippy_utils/src/ty/type_certainty/certainty.rs b/clippy_utils/src/ty/type_certainty/certainty.rs index 41cb00122cac..fe3095e1ec33 100644 --- a/clippy_utils/src/ty/type_certainty/certainty.rs +++ b/clippy_utils/src/ty/type_certainty/certainty.rs @@ -41,13 +41,7 @@ impl Meet for Option { impl TryJoin for Option { fn try_join(self, other: Self) -> Option { match (self, other) { - (Some(lhs), Some(rhs)) => { - if lhs == rhs { - Some(Some(lhs)) - } else { - None - } - }, + (Some(lhs), Some(rhs)) => (lhs == rhs).then_some(Some(lhs)), (Some(def_id), _) | (_, Some(def_id)) => Some(Some(def_id)), (None, None) => Some(None), }