From bdf2dceec12bddf0def1b6f8b462f7257d8ff046 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Mon, 15 Mar 2021 19:20:01 +0100 Subject: [PATCH] Get rid of some unused dependecies --- Cargo.toml | 2 ++ clippy_lints/Cargo.toml | 3 --- clippy_utils/Cargo.toml | 2 -- clippy_utils/src/lib.rs | 9 +++------ 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2b9488de289..dcc3294f8a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,6 +37,8 @@ clippy-mini-macro-test = { version = "0.2", path = "mini-macro" } serde = { version = "1.0", features = ["derive"] } derive-new = "0.5" regex = "1.4" +quote = "1" +syn = { version = "1", features = ["full"] } # A noop dependency that changes in the Rust repository, it's a bit of a hack. # See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust` diff --git a/clippy_lints/Cargo.toml b/clippy_lints/Cargo.toml index 6bd6c079276..e67d03d3338 100644 --- a/clippy_lints/Cargo.toml +++ b/clippy_lints/Cargo.toml @@ -20,7 +20,6 @@ pulldown-cmark = { version = "0.8", default-features = false } quine-mc_cluskey = "0.2.2" regex-syntax = "0.6" serde = { version = "1.0", features = ["derive"] } -smallvec = { version = "1", features = ["union"] } toml = "0.5.3" unicode-normalization = "0.1" semver = "0.11" @@ -28,8 +27,6 @@ rustc-semver = "1.1.0" # NOTE: cargo requires serde feat in its url dep # see url = { version = "2.1.0", features = ["serde"] } -quote = "1" -syn = { version = "1", features = ["full"] } [features] deny-warnings = [] diff --git a/clippy_utils/Cargo.toml b/clippy_utils/Cargo.toml index 9e07f140cf1..bd592dc03da 100644 --- a/clippy_utils/Cargo.toml +++ b/clippy_utils/Cargo.toml @@ -10,8 +10,6 @@ if_chain = "1.0.0" itertools = "0.9" regex-syntax = "0.6" serde = { version = "1.0", features = ["derive"] } -smallvec = { version = "1", features = ["union"] } -toml = "0.5.3" unicode-normalization = "0.1" rustc-semver="1.1.0" diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index d3cf2a34709..3efa84f6b86 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -79,7 +79,6 @@ use rustc_span::symbol::{kw, Ident, Symbol}; use rustc_span::{Span, DUMMY_SP}; use rustc_target::abi::Integer; -use smallvec::SmallVec; use crate::consts::{constant, Constant}; use crate::ty::is_recursively_primitive_type; @@ -1152,11 +1151,9 @@ pub fn match_panic_def_id(cx: &LateContext<'_>, did: DefId) -> bool { /// sequence of `if/else`. /// E.g., this returns `([a, b], [c, d, e])` for the expression /// `if a { c } else if b { d } else { e }`. -pub fn if_sequence<'tcx>( - mut expr: &'tcx Expr<'tcx>, -) -> (SmallVec<[&'tcx Expr<'tcx>; 1]>, SmallVec<[&'tcx Block<'tcx>; 1]>) { - let mut conds = SmallVec::new(); - let mut blocks: SmallVec<[&Block<'_>; 1]> = SmallVec::new(); +pub fn if_sequence<'tcx>(mut expr: &'tcx Expr<'tcx>) -> (Vec<&'tcx Expr<'tcx>>, Vec<&'tcx Block<'tcx>>) { + let mut conds = Vec::new(); + let mut blocks: Vec<&Block<'_>> = Vec::new(); while let ExprKind::If(ref cond, ref then_expr, ref else_expr) = expr.kind { conds.push(&**cond);