Skip to content

Commit 06e8ff7

Browse files
committed
fix: return true everywhere we emit the lint
1 parent 4673b25 commit 06e8ff7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

clippy_lints/src/types/rc_buffer.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
2424
diag.span_suggestion(hir_ty.span, "try", format!("Rc<{alternate}>"), app);
2525
},
2626
);
27+
true
2728
} else {
2829
let Some(ty) = qpath_generic_tys(qpath).next() else {
2930
return false;
@@ -55,7 +56,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
5556
);
5657
},
5758
);
58-
return true;
59+
true
5960
}
6061
} else if name == Some(sym::Arc) {
6162
if let Some(alternate) = match_buffer_type(cx, qpath) {
@@ -69,6 +70,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
6970
diag.span_suggestion(hir_ty.span, "try", format!("Arc<{alternate}>"), app);
7071
},
7172
);
73+
true
7274
} else if let Some(ty) = qpath_generic_tys(qpath).next() {
7375
let Some(id) = path_def_id(cx, ty) else { return false };
7476
if !cx.tcx.is_diagnostic_item(sym::Vec, id) {
@@ -97,11 +99,13 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
9799
);
98100
},
99101
);
100-
return true;
102+
true
103+
} else {
104+
false
101105
}
106+
} else {
107+
false
102108
}
103-
104-
false
105109
}
106110

107111
fn match_buffer_type(cx: &LateContext<'_>, qpath: &QPath<'_>) -> Option<&'static str> {

0 commit comments

Comments
 (0)