about summary refs log tree commit diff
path: root/src/mut_reference.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-01-04 09:56:12 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-01-04 09:56:12 +0530
commitc9342d01213ca1663d2cdf23289bae024823ae6a (patch)
tree505829eeee2dc85b41f7e2aa7cc44df3d9862a9e /src/mut_reference.rs
parent839ad09689e417d1d9e84eb24c627226765f8322 (diff)
downloadrust-c9342d01213ca1663d2cdf23289bae024823ae6a.tar.gz
rust-c9342d01213ca1663d2cdf23289bae024823ae6a.zip
fmt clippy
Diffstat (limited to 'src/mut_reference.rs')
-rw-r--r--src/mut_reference.rs20
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));
                     }
                 }
                 _ => {}