Skip to content

Commit 1ff2f3f

Browse files
flip1995phansch
authored andcommitted
Fix dogfood errors
1 parent c1f2370 commit 1ff2f3f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_lints/src/collect.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ declare_clippy_lint! {
4343
"missed shortcircuit opportunity on collect"
4444
}
4545

46-
#[derive(Clone)]
46+
#[derive(Clone, Default)]
4747
pub struct Pass {
4848
// To ensure that we do not lint the same expression more than once
4949
seen_expr_nodes: HashSet<NodeId>,
@@ -69,7 +69,7 @@ struct Suggestion {
6969

7070
fn format_suggestion_pattern<'a, 'tcx>(
7171
cx: &LateContext<'a, 'tcx>,
72-
collection_ty: TypeVariants,
72+
collection_ty: &TypeVariants,
7373
is_option: bool,
7474
) -> String {
7575
let collection_pat = match collection_ty {
@@ -125,13 +125,13 @@ fn check_expr_for_collect<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr
125125

126126
return if match_type(cx, normal_ty, &paths::OPTION) {
127127
Some(Suggestion {
128-
pattern: format_suggestion_pattern(cx, collect_ty.sty.clone(), true),
128+
pattern: format_suggestion_pattern(cx, &collect_ty.sty.clone(), true),
129129
type_colloquial: "Option",
130130
success_variant: "Some",
131131
})
132132
} else if match_type(cx, normal_ty, &paths::RESULT) {
133133
Some(Suggestion {
134-
pattern: format_suggestion_pattern(cx, collect_ty.sty.clone(), false),
134+
pattern: format_suggestion_pattern(cx, &collect_ty.sty.clone(), false),
135135
type_colloquial: "Result",
136136
success_variant: "Ok",
137137
})

0 commit comments

Comments
 (0)