Skip to content

Commit

Permalink
Merge pull request #3226 from matthiaskrgr/rustup_smallvec
Browse files Browse the repository at this point in the history
rustup
  • Loading branch information
phansch authored Sep 26, 2018
2 parents 66afff9 + fc35c20 commit a72e786
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ unicode-normalization = "0.1"
pulldown-cmark = "0.1"
url = "1.7.0"
if_chain = "0.1.3"
smallvec = { version = "0.6.5", features = ["union"] }

[features]
debugging = []
8 changes: 4 additions & 4 deletions clippy_lints/src/copies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::rustc_data_structures::fx::FxHashMap;
use std::collections::hash_map::Entry;
use std::hash::BuildHasherDefault;
use crate::syntax::symbol::LocalInternedString;
use crate::rustc_data_structures::small_vec::OneVector;
use smallvec::SmallVec;
use crate::utils::{SpanlessEq, SpanlessHash};
use crate::utils::{get_parent_expr, in_macro, snippet, span_lint_and_then, span_note_and_lint};

Expand Down Expand Up @@ -235,9 +235,9 @@ fn lint_match_arms(cx: &LateContext<'_, '_>, expr: &Expr) {
/// sequence of `if/else`.
/// Eg. would return `([a, b], [c, d, e])` for the expression
/// `if a { c } else if b { d } else { e }`.
fn if_sequence(mut expr: &Expr) -> (OneVector<&Expr>, OneVector<&Block>) {
let mut conds = OneVector::new();
let mut blocks: OneVector<&Block> = OneVector::new();
fn if_sequence(mut expr: &Expr) -> (SmallVec<[&Expr; 1]>, SmallVec<[&Block; 1]>) {
let mut conds = SmallVec::new();
let mut blocks: SmallVec<[&Block; 1]> = SmallVec::new();

while let ExprKind::If(ref cond, ref then_expr, ref else_expr) = expr.node {
conds.push(&**cond);
Expand Down

0 comments on commit a72e786

Please sign in to comment.