mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-02 02:46:06 +00:00
ranges: remove unneeded as_str()
This commit is contained in:
parent
c8a2e848ab
commit
cc8f33d915
@ -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. \
|
||||
|
Loading…
Reference in New Issue
Block a user