about summary refs log tree commit diff
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2019-10-05 12:42:09 +0200
committerflip1995 <hello@philkrones.com>2019-10-05 12:42:09 +0200
commit3aa531c194c4a73ec3238726544cb249b0fbc9ff (patch)
treef40a855c7fc67a23b738334fd8d4f0eb8974960e
parent3b23092b69a218f300abfd8ee629f4865486e83c (diff)
downloadrust-3aa531c194c4a73ec3238726544cb249b0fbc9ff.tar.gz
rust-3aa531c194c4a73ec3238726544cb249b0fbc9ff.zip
Run util/dev fmt
-rw-r--r--clippy_lints/src/escape.rs16
-rw-r--r--clippy_lints/src/methods/mod.rs10
-rw-r--r--clippy_lints/src/needless_pass_by_value.rs18
-rw-r--r--clippy_lints/src/utils/mod.rs2
4 files changed, 11 insertions, 35 deletions
diff --git a/clippy_lints/src/escape.rs b/clippy_lints/src/escape.rs
index 90e23bd9886..19f497ffd41 100644
--- a/clippy_lints/src/escape.rs
+++ b/clippy_lints/src/escape.rs
@@ -78,15 +78,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxedLocal {
 
         let fn_def_id = cx.tcx.hir().local_def_id(hir_id);
         let region_scope_tree = &cx.tcx.region_scope_tree(fn_def_id);
-        ExprUseVisitor::new(
-            &mut v,
-            cx.tcx,
-            fn_def_id,
-            cx.param_env,
-            region_scope_tree,
-            cx.tables,
-        )
-        .consume_body(body);
+        ExprUseVisitor::new(&mut v, cx.tcx, fn_def_id, cx.param_env, region_scope_tree, cx.tables).consume_body(body);
 
         for node in v.set {
             span_lint(
@@ -145,11 +137,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
         }
     }
 
-    fn borrow(
-        &mut self,
-        cmt: &cmt_<'tcx>,
-        _: ty::BorrowKind,
-    ) {
+    fn borrow(&mut self, cmt: &cmt_<'tcx>, _: ty::BorrowKind) {
         if let Categorization::Local(lid) = cmt.cat {
             self.set.remove(&lid);
         }
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs
index 526cb6ca610..d10d635e0e8 100644
--- a/clippy_lints/src/methods/mod.rs
+++ b/clippy_lints/src/methods/mod.rs
@@ -21,11 +21,11 @@ use syntax::symbol::{sym, LocalInternedString, Symbol};
 use crate::utils::usage::mutated_variables;
 use crate::utils::{
     get_arg_name, get_parent_expr, get_trait_def_id, has_iter_method, implements_trait, in_macro, is_copy,
-    is_ctor_or_promotable_const_function, is_expn_of, is_type_diagnostic_item, iter_input_pats, last_path_segment, match_def_path,
-    match_qpath, match_trait_method, match_type, match_var, method_calls, method_chain_args, paths, remove_blocks,
-    return_ty, same_tys, single_segment_path, snippet, snippet_with_applicability, snippet_with_macro_callsite,
-    span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then, span_note_and_lint, sugg, walk_ptrs_ty,
-    walk_ptrs_ty_depth, SpanlessEq,
+    is_ctor_or_promotable_const_function, is_expn_of, is_type_diagnostic_item, iter_input_pats, last_path_segment,
+    match_def_path, match_qpath, match_trait_method, match_type, match_var, method_calls, method_chain_args, paths,
+    remove_blocks, return_ty, same_tys, single_segment_path, snippet, snippet_with_applicability,
+    snippet_with_macro_callsite, span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then,
+    span_note_and_lint, sugg, walk_ptrs_ty, walk_ptrs_ty_depth, SpanlessEq,
 };
 
 declare_clippy_lint! {
diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs
index acad6459cf2..80f178289e4 100644
--- a/clippy_lints/src/needless_pass_by_value.rs
+++ b/clippy_lints/src/needless_pass_by_value.rs
@@ -136,15 +136,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
         } = {
             let mut ctx = MovedVariablesCtxt::default();
             let region_scope_tree = &cx.tcx.region_scope_tree(fn_def_id);
-            euv::ExprUseVisitor::new(
-                &mut ctx,
-                cx.tcx,
-                fn_def_id,
-                cx.param_env,
-                region_scope_tree,
-                cx.tables,
-            )
-            .consume_body(body);
+            euv::ExprUseVisitor::new(&mut ctx, cx.tcx, fn_def_id, cx.param_env, region_scope_tree, cx.tables)
+                .consume_body(body);
             ctx
         };
 
@@ -349,12 +342,7 @@ impl<'tcx> euv::Delegate<'tcx> for MovedVariablesCtxt {
         }
     }
 
-    fn borrow(
-        &mut self,
-        _: &mc::cmt_<'tcx>,
-        _: ty::BorrowKind,
-    ) {
-    }
+    fn borrow(&mut self, _: &mc::cmt_<'tcx>, _: ty::BorrowKind) {}
 
     fn mutate(&mut self, _: &mc::cmt_<'tcx>) {}
 }
diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs
index 9aca35c91cf..ae288f460ea 100644
--- a/clippy_lints/src/utils/mod.rs
+++ b/clippy_lints/src/utils/mod.rs
@@ -811,7 +811,7 @@ pub fn is_ctor_or_promotable_const_function(cx: &LateContext<'_, '_>, expr: &Exp
                 def::Res::Def(DefKind::Variant, ..) | Res::Def(DefKind::Ctor(..), _) => true,
                 def::Res::Def(_, def_id) => cx.tcx.is_promotable_const_fn(def_id),
                 _ => false,
-            }
+            };
         }
     }
     false