We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5a6c95 commit 9ab6146Copy full SHA for 9ab6146
clippy_lints/src/map_unit_fn.rs
@@ -97,11 +97,7 @@ declare_clippy_lint! {
97
declare_lint_pass!(MapUnit => [OPTION_MAP_UNIT_FN, RESULT_MAP_UNIT_FN]);
98
99
fn is_unit_type(ty: Ty<'_>) -> bool {
100
- match ty.kind() {
101
- ty::Tuple(slice) => slice.is_empty(),
102
- ty::Never => true,
103
- _ => false,
104
- }
+ ty.is_unit() || ty.is_never()
105
}
106
107
fn is_unit_function(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> bool {
0 commit comments