Skip to content

Commit 12426b6

Browse files
committed
fix: return true everywhere we emit the lint
1 parent 1aa5b99 commit 12426b6

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
@@ -25,6 +25,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
2525
diag.span_suggestion(hir_ty.span, "try", format!("Rc<{alternate}>"), app);
2626
},
2727
);
28+
true
2829
} else {
2930
let Some(ty) = qpath_generic_tys(qpath).next() else {
3031
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
if !ty.basic_res().is_diag_item(cx, sym::Vec) {
7476
return false;
@@ -96,11 +98,13 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
9698
);
9799
},
98100
);
99-
return true;
101+
true
102+
} else {
103+
false
100104
}
105+
} else {
106+
false
101107
}
102-
103-
false
104108
}
105109

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

0 commit comments

Comments
 (0)