]> git.lizzy.rs Git - rust.git/commitdiff
fmt fixes
authorPhilipp Hansch <dev@phansch.net>
Sun, 3 Mar 2019 12:00:49 +0000 (13:00 +0100)
committerPhilipp Hansch <dev@phansch.net>
Sun, 3 Mar 2019 12:05:39 +0000 (13:05 +0100)
clippy_lints/src/escape.rs
clippy_lints/src/len_zero.rs
clippy_lints/src/loops.rs

index 6060d3e7b28e0c6c80664022fbaf3000516f9825..45ecdc3d31034cf64b05e659951aec98a800f6f2 100644 (file)
@@ -112,9 +112,7 @@ fn consume_pat(&mut self, consume_pat: &Pat, cmt: &cmt_<'tcx>, _: ConsumeMode) {
         let map = &self.cx.tcx.hir();
         if map.is_argument(map.hir_to_node_id(consume_pat.hir_id)) {
             // Skip closure arguments
-            if let Some(Node::Expr(..)) = map.find_by_hir_id(
-                map.get_parent_node_by_hir_id(consume_pat.hir_id))
-            {
+            if let Some(Node::Expr(..)) = map.find_by_hir_id(map.get_parent_node_by_hir_id(consume_pat.hir_id)) {
                 return;
             }
             if is_non_trait_box(cmt.ty) && !self.is_large_box(cmt.ty) {
index d66fcee97ecdbb7ad071ddfb8982edaae4c89d92..094cfcf1b1f654b92118133a40a241b45799a990 100644 (file)
@@ -194,7 +194,10 @@ fn is_named_self(cx: &LateContext<'_, '_>, item: &ImplItemRef, name: &str) -> bo
     }
 
     let is_empty = if let Some(is_empty) = impl_items.iter().find(|i| is_named_self(cx, i, "is_empty")) {
-        if cx.access_levels.is_exported(cx.tcx.hir().hir_to_node_id(is_empty.id.hir_id)) {
+        if cx
+            .access_levels
+            .is_exported(cx.tcx.hir().hir_to_node_id(is_empty.id.hir_id))
+        {
             return;
         } else {
             "a private"
index c8f557d3341e2523b6f7f9281cf8e0a819996d40..811e7fc6c6338f5d90f47d2e67057cbe4ab5857a 100644 (file)
@@ -2051,9 +2051,9 @@ enum VarState {
 
 /// Scan a for loop for variables that are incremented exactly once.
 struct IncrementVisitor<'a, 'tcx: 'a> {
-    cx: &'a LateContext<'a, 'tcx>,       // context reference
-    states: FxHashMap<HirId, VarState>,  // incremented variables
-    depth: u32,                          // depth of conditional expressions
+    cx: &'a LateContext<'a, 'tcx>,      // context reference
+    states: FxHashMap<HirId, VarState>, // incremented variables
+    depth: u32,                         // depth of conditional expressions
     done: bool,
 }