]> git.lizzy.rs Git - rust.git/commitdiff
rustfmt a little
authorSeo Sanghyeon <sanxiyn@gmail.com>
Tue, 17 Nov 2015 05:22:57 +0000 (14:22 +0900)
committerSeo Sanghyeon <sanxiyn@gmail.com>
Tue, 17 Nov 2015 05:22:57 +0000 (14:22 +0900)
src/minmax.rs
src/mut_mut.rs
src/needless_bool.rs
src/needless_features.rs
src/precedence.rs
src/strings.rs
src/zero_div_zero.rs

index 7ed651847275157fdb07dcca11ac4b6e12e45899..9eb8a030e15357e09f748b3846a2f352924917de 100644 (file)
@@ -17,7 +17,7 @@
 
 impl LintPass for MinMaxPass {
     fn get_lints(&self) -> LintArray {
-       lint_array!(MIN_MAX)
+        lint_array!(MIN_MAX)
     }
 }
 
index 9b6a5d9ddcc75d131ae6dde18e28d7fd7c38824c..a92338165dd34c0e1e9da7fb6e6eb891b364d130 100644 (file)
@@ -19,7 +19,7 @@ fn get_lints(&self) -> LintArray {
 
 impl LateLintPass for MutMut {
     fn check_expr(&mut self, cx: &LateContext, expr: &Expr) {
-       check_expr_mut(cx, expr)
+        check_expr_mut(cx, expr)
     }
 
     fn check_ty(&mut self, cx: &LateContext, ty: &Ty) {
@@ -31,7 +31,7 @@ fn check_ty(&mut self, cx: &LateContext, ty: &Ty) {
 fn check_expr_mut(cx: &LateContext, expr: &Expr) {
     if in_external_macro(cx, expr.span) { return; }
 
-    fn unwrap_addr(expr : &Expr) -> Option<&Expr> {
+    fn unwrap_addr(expr: &Expr) -> Option<&Expr> {
         match expr.node {
             ExprAddrOf(MutMutable, ref e) => Option::Some(e),
             _ => Option::None
@@ -53,7 +53,7 @@ fn unwrap_addr(expr : &Expr) -> Option<&Expr> {
     })
 }
 
-fn unwrap_mut(ty : &Ty) -> Option<&Ty> {
+fn unwrap_mut(ty: &Ty) -> Option<&Ty> {
     match ty.node {
         TyRptr(_, MutTy{ ty: ref pty, mutbl: MutMutable }) => Option::Some(pty),
         _ => Option::None
index 52f23c7518a6a1eb048478192546f7e2bcd8fd4b..e4d3b00218ed3fcaa23b7d130f12273379a556db 100644 (file)
@@ -31,10 +31,12 @@ fn check_expr(&mut self, cx: &LateContext, e: &Expr) {
             match (fetch_bool_block(then_block), fetch_bool_expr(else_expr)) {
                 (Some(true), Some(true)) => {
                     span_lint(cx, NEEDLESS_BOOL, e.span,
-                              "this if-then-else expression will always return true"); }
+                              "this if-then-else expression will always return true");
+                }
                 (Some(false), Some(false)) => {
                     span_lint(cx, NEEDLESS_BOOL, e.span,
-                              "this if-then-else expression will always return false"); }
+                              "this if-then-else expression will always return false");
+                }
                 (Some(true), Some(false)) => {
                     let pred_snip = snippet(cx, pred.span, "..");
                     let hint = if pred_snip == ".." { "its predicate".into() } else {
index b1d38df73113cc671dd07f28bb88177d63ca7dfb..44db5e922213ceb100832f9f74fbabb5a434a9a7 100644 (file)
@@ -5,7 +5,7 @@
 use rustc::lint::*;
 use rustc_front::hir::*;
 
-use utils::{span_lint};
+use utils::span_lint;
 use utils;
 
 declare_lint! {
@@ -27,7 +27,7 @@
 
 impl LintPass for NeedlessFeaturesPass {
     fn get_lints(&self) -> LintArray {
-        lint_array!(UNSTABLE_AS_SLICE,UNSTABLE_AS_MUT_SLICE)
+        lint_array!(UNSTABLE_AS_SLICE, UNSTABLE_AS_MUT_SLICE)
     }
 }
 
index b7dbe26855733dfd70bd8b06bbab9b6273aa9fdd..b659bd647a7c527062023c257223780b2cc03eab 100644 (file)
@@ -53,7 +53,7 @@ fn check_expr(&mut self, cx: &EarlyContext, expr: &Expr) {
                                      method call. Consider adding parentheses \
                                      to clarify your intent: -({})",
                                      snippet(cx, rhs.span, ".."))),
-                                _ => ()
+                            _ => ()
                         }
                     }
                 }
@@ -62,21 +62,21 @@ fn check_expr(&mut self, cx: &EarlyContext, expr: &Expr) {
     }
 }
 
-fn is_arith_expr(expr : &Expr) -> bool {
+fn is_arith_expr(expr: &Expr) -> bool {
     match expr.node {
         ExprBinary(Spanned { node: op, ..}, _, _) => is_arith_op(op),
         _ => false
     }
 }
 
-fn is_bit_op(op : BinOp_) -> bool {
+fn is_bit_op(op: BinOp_) -> bool {
     match op {
         BiBitXor | BiBitAnd | BiBitOr | BiShl | BiShr => true,
         _ => false
     }
 }
 
-fn is_arith_op(op : BinOp_) -> bool {
+fn is_arith_op(op: BinOp_) -> bool {
     match op {
         BiAdd | BiSub | BiMul | BiDiv | BiRem => true,
         _ => false
index 6bbf94004b0edc25257efe0148f64a700d061e98..0827465753822d88da876bbdc0e6b72897bba63b 100644 (file)
@@ -51,7 +51,7 @@ fn check_expr(&mut self, cx: &LateContext, e: &Expr) {
                     "you added something to a string. \
                      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(cx, src, target) {
                 span_lint(cx, STRING_ADD_ASSIGN, e.span,
                     "you assigned the result of adding something to this string. \
index 37d5d8904e124cc1094686672fafe8fe21c34145..484348c5a37f0ac79cf24f148a12855458a5d871 100644 (file)
@@ -1,7 +1,7 @@
 use rustc::lint::*;
 use rustc_front::hir::*;
 
-use utils::{span_help_and_lint};
+use utils::span_help_and_lint;
 use consts::{Constant, constant_simple, FloatWidth};
 
 /// ZeroDivZeroPass is a pass that checks for a binary expression that consists