Skip to content

Commit

Permalink
Fix dogfood errors
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Jun 8, 2018
1 parent ab1d6b2 commit 36993f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clippy_lints/src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ declare_clippy_lint! {
"missed shortcircuit opportunity on collect"
}

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

fn format_suggestion_pattern<'a, 'tcx>(
cx: &LateContext<'a, 'tcx>,
collection_ty: TypeVariants,
collection_ty: &TypeVariants,
is_option: bool,
) -> String {
let collection_pat = match collection_ty {
Expand Down Expand Up @@ -125,13 +125,13 @@ fn check_expr_for_collect<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr

return if match_type(cx, normal_ty, &paths::OPTION) {
Some(Suggestion {
pattern: format_suggestion_pattern(cx, collect_ty.sty.clone(), true),
pattern: format_suggestion_pattern(cx, &collect_ty.sty.clone(), true),
type_colloquial: "Option",
success_variant: "Some",
})
} else if match_type(cx, normal_ty, &paths::RESULT) {
Some(Suggestion {
pattern: format_suggestion_pattern(cx, collect_ty.sty.clone(), false),
pattern: format_suggestion_pattern(cx, &collect_ty.sty.clone(), false),
type_colloquial: "Result",
success_variant: "Ok",
})
Expand Down

0 comments on commit 36993f8

Please sign in to comment.