diff --git a/selene-lib/src/lints/if_same_then_else.rs b/selene-lib/src/lints/if_same_then_else.rs index 502e1bbf..c8874b9c 100644 --- a/selene-lib/src/lints/if_same_then_else.rs +++ b/selene-lib/src/lints/if_same_then_else.rs @@ -55,8 +55,8 @@ impl Visitor for IfSameThenElseVisitor { fn visit_if(&mut self, if_block: &ast::If) { let else_ifs = if_block .else_if() - .map(|else_ifs| else_ifs.iter().collect()) - .unwrap_or_else(Vec::new); + .map(|else_ifs| else_ifs.iter().collect::>()) + .unwrap_or_default(); let mut blocks = Vec::with_capacity(2 + else_ifs.len()); blocks.push(if_block.block());