We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1546cc4 commit 6d4e1bdCopy full SHA for 6d4e1bd
src/strings.rs
@@ -140,7 +140,7 @@ impl LateLintPass for StringLitAsBytes {
140
if name.node.as_str() == "as_bytes" {
141
if let ExprLit(ref lit) = args[0].node {
142
if let LitKind::Str(ref lit_content, _) = lit.node {
143
- if lit_content.chars().all(|c| c.is_ascii()) && !in_macro(cx, e.span) {
+ if lit_content.chars().all(|c| c.is_ascii()) && !in_macro(cx, args[0].span) {
144
let msg = format!("calling `as_bytes()` on a string literal. \
145
Consider using a byte string literal instead: \
146
`b{}`",
0 commit comments