Skip to content

Commit a72e786

Browse files
authored
Merge pull request #3226 from matthiaskrgr/rustup_smallvec
rustup
2 parents 66afff9 + fc35c20 commit a72e786

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

clippy_lints/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ unicode-normalization = "0.1"
3333
pulldown-cmark = "0.1"
3434
url = "1.7.0"
3535
if_chain = "0.1.3"
36+
smallvec = { version = "0.6.5", features = ["union"] }
3637

3738
[features]
3839
debugging = []

clippy_lints/src/copies.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::rustc_data_structures::fx::FxHashMap;
66
use std::collections::hash_map::Entry;
77
use std::hash::BuildHasherDefault;
88
use crate::syntax::symbol::LocalInternedString;
9-
use crate::rustc_data_structures::small_vec::OneVector;
9+
use smallvec::SmallVec;
1010
use crate::utils::{SpanlessEq, SpanlessHash};
1111
use crate::utils::{get_parent_expr, in_macro, snippet, span_lint_and_then, span_note_and_lint};
1212

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

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

0 commit comments

Comments
 (0)