This commit is contained in:
Mateusz Mikuła
2018-06-28 15:46:58 +02:00
parent b7d95f486b
commit 48cb6e273e
48 changed files with 186 additions and 178 deletions

View File

@@ -149,7 +149,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for StringLitAsBytes {
use crate::utils::{in_macro, snippet};
if let ExprMethodCall(ref path, _, ref args) = e.node {
if path.name == "as_bytes" {
if path.ident.name == "as_bytes" {
if let ExprLit(ref lit) = args[0].node {
if let LitKind::Str(ref lit_content, _) = lit.node {
if lit_content.as_str().chars().all(|c| c.is_ascii()) && !in_macro(args[0].span) {