Skip to content

Commit 07e8482

Browse files
committed
remove if_let_chain
1 parent c427415 commit 07e8482

File tree

3 files changed

+6
-57
lines changed

3 files changed

+6
-57
lines changed

clippy_lints/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ toml = "0.4"
2828
unicode-normalization = "0.1"
2929
pulldown-cmark = "0.0.15"
3030
url = "1.5.0"
31+
if_chain = "0.1"
3132

3233
[features]
3334
debugging = []

clippy_lints/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#![feature(inclusive_range_syntax, range_contains)]
1212
#![allow(unknown_lints, indexing_slicing, shadow_reuse, missing_docs_in_private_items)]
1313

14+
#![recursion_limit="256"]
15+
1416
#[macro_use]
1517
extern crate rustc;
1618
extern crate rustc_typeck;
@@ -54,6 +56,9 @@ extern crate itertools;
5456
extern crate pulldown_cmark;
5557
extern crate url;
5658

59+
#[macro_use]
60+
extern crate if_chain;
61+
5762
macro_rules! declare_restriction_lint {
5863
{ pub $name:tt, $description:tt } => {
5964
declare_lint! { pub $name, Allow, $description }

clippy_lints/src/utils/mod.rs

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -37,63 +37,6 @@ pub use self::hir_utils::{SpanlessEq, SpanlessHash};
3737

3838
pub type MethodArgs = HirVec<P<Expr>>;
3939

40-
/// Produce a nested chain of if-lets and ifs from the patterns:
41-
///
42-
/// ```rust,ignore
43-
/// if_let_chain! {[
44-
/// let Some(y) = x,
45-
/// y.len() == 2,
46-
/// let Some(z) = y,
47-
/// ], {
48-
/// block
49-
/// }}
50-
/// ```
51-
///
52-
/// becomes
53-
///
54-
/// ```rust,ignore
55-
/// if let Some(y) = x {
56-
/// if y.len() == 2 {
57-
/// if let Some(z) = y {
58-
/// block
59-
/// }
60-
/// }
61-
/// }
62-
/// ```
63-
#[macro_export]
64-
macro_rules! if_let_chain {
65-
([let $pat:pat = $expr:expr, $($tt:tt)+], $block:block) => {
66-
if let $pat = $expr {
67-
if_let_chain!{ [$($tt)+], $block }
68-
}
69-
};
70-
([let $pat:pat = $expr:expr], $block:block) => {
71-
if let $pat = $expr {
72-
$block
73-
}
74-
};
75-
([let $pat:pat = $expr:expr,], $block:block) => {
76-
if let $pat = $expr {
77-
$block
78-
}
79-
};
80-
([$expr:expr, $($tt:tt)+], $block:block) => {
81-
if $expr {
82-
if_let_chain!{ [$($tt)+], $block }
83-
}
84-
};
85-
([$expr:expr], $block:block) => {
86-
if $expr {
87-
$block
88-
}
89-
};
90-
([$expr:expr,], $block:block) => {
91-
if $expr {
92-
$block
93-
}
94-
};
95-
}
96-
9740
pub mod higher;
9841

9942
/// Returns true if the two spans come from differing expansions (i.e. one is

0 commit comments

Comments
 (0)