From cc8f33d9152c38ca59cb79ccb89aca70fb3a7420 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 23 Aug 2015 16:34:23 +0200 Subject: [PATCH] ranges: remove unneeded as_str() --- src/ranges.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ranges.rs b/src/ranges.rs index d1a0a7e702e..914b4daa6be 100644 --- a/src/ranges.rs +++ b/src/ranges.rs @@ -20,7 +20,7 @@ impl LintPass for StepByZero { if let ExprMethodCall(Spanned { node: ref ident, .. }, _, ref args) = expr.node { // Only warn on literal ranges. - if ident.name.as_str() == "step_by" && args.len() == 2 && + if ident.name == "step_by" && args.len() == 2 && is_range(cx, &args[0]) && is_lit_zero(&args[1]) { cx.span_lint(RANGE_STEP_BY_ZERO, expr.span, "Range::step_by(0) produces an infinite iterator. \