mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
grammar
This commit is contained in:
parent
801f01d001
commit
30a6764adb
1 changed files with 2 additions and 2 deletions
|
@ -47,13 +47,13 @@ impl LintPass for StringAdd {
|
||||||
}
|
}
|
||||||
//TODO check for duplicates
|
//TODO check for duplicates
|
||||||
span_lint(cx, STRING_ADD, e.span,
|
span_lint(cx, STRING_ADD, e.span,
|
||||||
"you add something to a string. \
|
"you added something to a string. \
|
||||||
Consider using `String::push_str()` instead.")
|
Consider using `String::push_str()` instead.")
|
||||||
}
|
}
|
||||||
} else if let &ExprAssign(ref target, ref src) = &e.node {
|
} else if let &ExprAssign(ref target, ref src) = &e.node {
|
||||||
if is_string(cx, target) && is_add(src, target) {
|
if is_string(cx, target) && is_add(src, target) {
|
||||||
span_lint(cx, STRING_ADD_ASSIGN, e.span,
|
span_lint(cx, STRING_ADD_ASSIGN, e.span,
|
||||||
"you assign the result of adding something to this string. \
|
"you assigned the result of adding something to this string. \
|
||||||
Consider using `String::push_str()` instead.")
|
Consider using `String::push_str()` instead.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue