]> git.lizzy.rs Git - rust.git/commitdiff
Run rustfmt
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Fri, 12 May 2017 10:09:52 +0000 (12:09 +0200)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Fri, 12 May 2017 10:09:52 +0000 (12:09 +0200)
clippy_lints/src/misc.rs
clippy_lints/src/types.rs
clippy_lints/src/utils/conf.rs

index dbadce6193cd1cf596f5611f0c8c88d949de16c6..b5acafac1698d53be8b4e7994a3097178b903b7a 100644 (file)
@@ -465,8 +465,13 @@ fn check_to_owned(cx: &LateContext, expr: &Expr, other: &Expr) {
         return;
     }
 
-    span_lint_and_then(cx, CMP_OWNED, expr.span, "this creates an owned instance just for comparison", |db| {
-        // this is as good as our recursion check can get, we can't prove that the current function is called by
+    span_lint_and_then(cx,
+                       CMP_OWNED,
+                       expr.span,
+                       "this creates an owned instance just for comparison",
+                       |db| {
+        // this is as good as our recursion check can get, we can't prove that the current function is
+        // called by
         // PartialEq::eq, but we can at least ensure that this code is not part of it
         let parent_fn = cx.tcx.hir.get_parent(expr.id);
         let parent_impl = cx.tcx.hir.get_parent(parent_fn);
@@ -474,7 +479,8 @@ fn check_to_owned(cx: &LateContext, expr: &Expr, other: &Expr) {
             if let map::NodeItem(item) = cx.tcx.hir.get(parent_impl) {
                 if let ItemImpl(.., Some(ref trait_ref), _, _) = item.node {
                     if trait_ref.path.def.def_id() == partial_eq_trait_id {
-                        // we are implementing PartialEq, don't suggest not doing `to_owned`, otherwise we go into recursion
+                        // we are implementing PartialEq, don't suggest not doing `to_owned`, otherwise we go into
+                        // recursion
                         db.span_label(expr.span, "try calling implementing the comparison without allocating");
                         return;
                     }
index 7254862a38071f7adc8a440721d3664858b28a15..bdedd5a93bd319819921531179e4d1199a580e2b 100644 (file)
@@ -716,7 +716,7 @@ fn check_type(&self, cx: &LateContext, ty: &Ty) {
 }
 
 /// Walks a type and assigns a complexity score to it.
-struct TypeComplexityVisitor{
+struct TypeComplexityVisitor {
     /// total complexity score of the type
     score: u64,
     /// current nesting level
index 772f7f6ad451fdd47d76764a9ee4f4ea625f3ec7..0e6f88563827457e4bb6a9f302a3016d5b3d502f 100644 (file)
@@ -218,7 +218,7 @@ pub fn read(path: Option<&path::Path>) -> (Conf, Vec<Error>) {
     let path = if let Some(path) = path {
         path
     } else {
-        return default(Vec::new())
+        return default(Vec::new());
     };
 
     let file = match fs::File::open(path) {
@@ -226,7 +226,7 @@ pub fn read(path: Option<&path::Path>) -> (Conf, Vec<Error>) {
             let mut buf = String::new();
 
             if let Err(err) = file.read_to_string(&mut buf) {
-                return default(vec![err.into()])
+                return default(vec![err.into()]);
             }
 
             buf