Skip to content

Commit 42480fd

Browse files
committed
Rustup to rustc 1.36.0-nightly (1764b29 2019-05-12)
1 parent c79838e commit 42480fd

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

clippy_lints/src/approx_const.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ declare_lint_pass!(ApproxConstant => [APPROX_CONSTANT]);
5555
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ApproxConstant {
5656
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
5757
if let ExprKind::Lit(lit) = &e.node {
58-
check_lit(cx, lit, e);
58+
check_lit(cx, &lit.node, e);
5959
}
6060
}
6161
}
6262

63-
fn check_lit(cx: &LateContext<'_, '_>, lit: &Lit, e: &Expr) {
64-
match lit.node {
63+
fn check_lit(cx: &LateContext<'_, '_>, lit: &LitKind, e: &Expr) {
64+
match *lit {
6565
LitKind::Float(s, FloatTy::F32) => check_known_consts(cx, e, s, "f32"),
6666
LitKind::Float(s, FloatTy::F64) => check_known_consts(cx, e, s, "f64"),
6767
LitKind::FloatUnsuffixed(s) => check_known_consts(cx, e, s, "f{32, 64}"),

clippy_lints/src/len_zero.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ fn check_cmp(cx: &LateContext<'_, '_>, span: Span, method: &Expr, lit: &Expr, op
218218
}
219219
}
220220

221-
check_len(cx, span, method_path.ident.name, args, lit, op, compare_to)
221+
check_len(cx, span, method_path.ident.name, args, &lit.node, op, compare_to)
222222
}
223223
}
224224

@@ -227,15 +227,11 @@ fn check_len(
227227
span: Span,
228228
method_name: Name,
229229
args: &[Expr],
230-
lit: &Lit,
230+
lit: &LitKind,
231231
op: &str,
232232
compare_to: u32,
233233
) {
234-
if let Spanned {
235-
node: LitKind::Int(lit, _),
236-
..
237-
} = *lit
238-
{
234+
if let LitKind::Int(lit, _) = *lit {
239235
// check if length is compared to the specified number
240236
if lit != u128::from(compare_to) {
241237
return;

0 commit comments

Comments
 (0)