]> git.lizzy.rs Git - rust.git/commitdiff
Run rustfmt
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Tue, 28 Feb 2017 13:29:06 +0000 (14:29 +0100)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Tue, 28 Feb 2017 13:29:06 +0000 (14:29 +0100)
src/main.rs

index c7681364f18e82e8278a67b2c1a5ec213fe743bb..12dd5d1f695b10e0c027e9f69593ff2154e7c670 100644 (file)
@@ -245,30 +245,31 @@ pub fn main() {
         };
 
         rustc_driver::in_rustc_thread(|| {
-            // this conditional check for the --sysroot flag is there so users can call `cargo-clippy` directly
-            // without having to pass --sysroot or anything
-            let mut args: Vec<String> = if env::args().any(|s| s == "--sysroot") {
-                env::args().collect()
-            } else {
-                env::args().chain(Some("--sysroot".to_owned())).chain(Some(sys_root)).collect()
-            };
+                // this conditional check for the --sysroot flag is there so users can call `cargo-clippy` directly
+                // without having to pass --sysroot or anything
+                let mut args: Vec<String> = if env::args().any(|s| s == "--sysroot") {
+                    env::args().collect()
+                } else {
+                    env::args().chain(Some("--sysroot".to_owned())).chain(Some(sys_root)).collect()
+                };
 
-            // this check ensures that dependencies are built but not linted and the final crate is
-            // linted but not built
-            let clippy_enabled = env::args().any(|s| s == "-Zno-trans");
+                // this check ensures that dependencies are built but not linted and the final crate is
+                // linted but not built
+                let clippy_enabled = env::args().any(|s| s == "-Zno-trans");
 
-            if clippy_enabled {
-                args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-clippy""#.to_owned()]);
-            }
+                if clippy_enabled {
+                    args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-clippy""#.to_owned()]);
+                }
 
-            let mut ccc = ClippyCompilerCalls::new(clippy_enabled);
-            let (result, _) = rustc_driver::run_compiler(&args, &mut ccc, None, None);
-            if let Err(err_count) = result {
-                if err_count > 0 {
-                    std::process::exit(1);
+                let mut ccc = ClippyCompilerCalls::new(clippy_enabled);
+                let (result, _) = rustc_driver::run_compiler(&args, &mut ccc, None, None);
+                if let Err(err_count) = result {
+                    if err_count > 0 {
+                        std::process::exit(1);
+                    }
                 }
-            }
-        }).expect("rustc_thread failed");
+            })
+            .expect("rustc_thread failed");
     }
 }