about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2019-03-10 12:00:17 +0100
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2019-03-10 12:00:17 +0100
commit1388f2488e09ae30a32eaf40f83d64c766ffa1e6 (patch)
tree7eff161d9fcbeb499629b691853e54d2fa9f6983
parent0d4a19c0d113cde4c6cd6baaf6c48efed0113a58 (diff)
downloadrust-1388f2488e09ae30a32eaf40f83d64c766ffa1e6.tar.gz
rust-1388f2488e09ae30a32eaf40f83d64c766ffa1e6.zip
rustfmt
-rw-r--r--src/driver.rs27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/driver.rs b/src/driver.rs
index 1430ba70fbe..e5925653655 100644
--- a/src/driver.rs
+++ b/src/driver.rs
@@ -8,9 +8,9 @@
 #[allow(unused_extern_crates)]
 extern crate rustc_driver;
 #[allow(unused_extern_crates)]
-extern crate rustc_plugin;
-#[allow(unused_extern_crates)]
 extern crate rustc_interface;
+#[allow(unused_extern_crates)]
+extern crate rustc_plugin;
 
 use rustc_interface::interface;
 use std::path::Path;
@@ -69,10 +69,14 @@ impl rustc_driver::Callbacks for ClippyCallbacks {
         let sess = compiler.session();
         let mut registry = rustc_plugin::registry::Registry::new(
             sess,
-            compiler.parse().expect(
-                "at this compilation stage \
-                    the crate must be parsed",
-            ).peek().span,
+            compiler
+                .parse()
+                .expect(
+                    "at this compilation stage \
+                     the crate must be parsed",
+                )
+                .peek()
+                .span,
         );
         registry.args_hidden = Some(Vec::new());
 
@@ -195,13 +199,12 @@ pub fn main() {
 
             let mut clippy = ClippyCallbacks;
             let mut default = rustc_driver::DefaultCallbacks;
-            let callbacks: &mut (dyn rustc_driver::Callbacks + Send) = if clippy_enabled {
-                &mut clippy
-            } else {
-                &mut default
-            };
+            let callbacks: &mut (dyn rustc_driver::Callbacks + Send) =
+                if clippy_enabled { &mut clippy } else { &mut default };
             let args = args;
             rustc_driver::run_compiler(&args, callbacks, None, None)
-        }).and_then(|result| result).is_err() as i32
+        })
+        .and_then(|result| result)
+        .is_err() as i32,
     )
 }