]> git.lizzy.rs Git - rust.git/commitdiff
Run rustfmt
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Mon, 13 Mar 2017 10:32:58 +0000 (11:32 +0100)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Mon, 13 Mar 2017 10:40:56 +0000 (11:40 +0100)
clippy_lints/src/misc.rs

index 885d10d2fd98d3e8f2d66206e2a4b7a362667163..328bba9f6fe7cc7a488f2c8747dd634b223c8b3b 100644 (file)
@@ -307,7 +307,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
                     if let Some(name) = get_item_name(cx, expr) {
                         let name = &*name.as_str();
                         if name == "eq" || name == "ne" || name == "is_nan" || name.starts_with("eq_") ||
-                        name.ends_with("_eq") {
+                           name.ends_with("_eq") {
                             return;
                         }
                     }
@@ -316,15 +316,15 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
                         let rhs = Sugg::hir(cx, right, "..");
 
                         db.span_suggestion(expr.span,
-                                        "consider comparing them within some error",
-                                        format!("({}).abs() < error", lhs - rhs));
+                                           "consider comparing them within some error",
+                                           format!("({}).abs() < error", lhs - rhs));
                         db.span_note(expr.span, "std::f32::EPSILON and std::f64::EPSILON are available.");
                     });
                 } else if op == BiRem && is_integer_literal(right, 1) {
                     span_lint(cx, MODULO_ONE, expr.span, "any number modulo 1 will be 0");
                 }
             },
-            _ => {}
+            _ => {},
         }
         if in_attributes_expansion(cx, expr) {
             // Don't lint things expanded by #[derive(...)], etc
@@ -380,9 +380,9 @@ fn check_nan(cx: &LateContext, path: &Path, expr: &Expr) {
     if !in_constant(cx, expr.id) {
         path.segments.last().map(|seg| if &*seg.name.as_str() == "NAN" {
             span_lint(cx,
-                    CMP_NAN,
-                    expr.span,
-                    "doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead");
+                      CMP_NAN,
+                      expr.span,
+                      "doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead");
         });
     }
 }