mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
Fix clippy error
This commit is contained in:
parent
a9c8d1bd90
commit
d171e8987e
1 changed files with 3 additions and 4 deletions
|
@ -40,11 +40,10 @@ impl LintPass for Pass {
|
|||
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
|
||||
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
|
||||
if let ExprAssign(ref target, _) = expr.node {
|
||||
match target.node {
|
||||
ExprField(ref base, _) => if is_temporary(base) && !is_adjusted(cx, base) {
|
||||
if let ExprField(ref base, _) = target.node {
|
||||
if is_temporary(base) && !is_adjusted(cx, base) {
|
||||
span_lint(cx, TEMPORARY_ASSIGNMENT, expr.span, "assignment to temporary");
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue