diff options
Diffstat (limited to 'src/mut_reference.rs')
| -rw-r--r-- | src/mut_reference.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mut_reference.rs b/src/mut_reference.rs index ddfd9ddcc13..d92e449e7f2 100644 --- a/src/mut_reference.rs +++ b/src/mut_reference.rs @@ -36,13 +36,12 @@ impl LateLintPass for UnnecessaryMutPassed { match borrowed_table.node_types.get(&fn_expr.id) { Some(function_type) => { if let ExprPath(_, ref path) = fn_expr.node { - check_arguments(cx, &arguments, function_type, - &format!("{}", path)); + check_arguments(cx, &arguments, function_type, &format!("{}", path)); } } None => unreachable!(), // A function with unknown type is called. - // If this happened the compiler would have aborted the - // compilation long ago. + // If this happened the compiler would have aborted the + // compilation long ago. }; @@ -50,8 +49,9 @@ impl LateLintPass for UnnecessaryMutPassed { ExprMethodCall(ref name, _, ref arguments) => { let method_call = MethodCall::expr(e.id); match borrowed_table.method_map.get(&method_call) { - Some(method_type) => check_arguments(cx, &arguments, method_type.ty, - &format!("{}", name.node.as_str())), + Some(method_type) => { + check_arguments(cx, &arguments, method_type.ty, &format!("{}", name.node.as_str())) + } None => unreachable!(), // Just like above, this should never happen. }; } @@ -68,10 +68,10 @@ fn check_arguments(cx: &LateContext, arguments: &[P<Expr>], type_definition: &Ty TypeVariants::TyRef(_, TypeAndMut {mutbl: MutImmutable, ..}) | TypeVariants::TyRawPtr(TypeAndMut {mutbl: MutImmutable, ..}) => { if let ExprAddrOf(MutMutable, _) = argument.node { - span_lint(cx, UNNECESSARY_MUT_PASSED, - argument.span, &format!("The function/method \"{}\" \ - doesn't need a mutable reference", - name)); + span_lint(cx, + UNNECESSARY_MUT_PASSED, + argument.span, + &format!("The function/method \"{}\" doesn't need a mutable reference", name)); } } _ => {} |
