Skip to content

Commit 5d72cc9

Browse files
committed
Run Rustfmt-nightly
1 parent 1265b46 commit 5d72cc9

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/main.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// error-pattern:yummy
22
#![feature(box_syntax)]
33
#![feature(rustc_private)]
4-
54
#![allow(unknown_lints, missing_docs_in_private_items)]
65

76
extern crate clippy_lints;
@@ -12,9 +11,9 @@ extern crate rustc_errors;
1211
extern crate rustc_plugin;
1312
extern crate syntax;
1413

15-
use rustc_driver::{driver, CompilerCalls, RustcDefaultCalls, Compilation};
16-
use rustc::session::{config, Session, CompileIncomplete};
17-
use rustc::session::config::{Input, ErrorOutputType};
14+
use rustc_driver::{driver, Compilation, CompilerCalls, RustcDefaultCalls};
15+
use rustc::session::{config, CompileIncomplete, Session};
16+
use rustc::session::config::{ErrorOutputType, Input};
1817
use std::collections::HashMap;
1918
use std::path::PathBuf;
2019
use std::process::{self, Command};
@@ -200,9 +199,9 @@ pub fn main() {
200199
if let Some("clippy") = std::env::args().nth(1).as_ref().map(AsRef::as_ref) {
201200
// this arm is executed on the initial call to `cargo clippy`
202201

203-
let manifest_path_arg = std::env::args().skip(2).find(|val| {
204-
val.starts_with("--manifest-path=")
205-
});
202+
let manifest_path_arg = std::env::args()
203+
.skip(2)
204+
.find(|val| val.starts_with("--manifest-path="));
206205

207206
let mut metadata =
208207
if let Ok(metadata) = cargo_metadata::metadata(manifest_path_arg.as_ref().map(AsRef::as_ref)) {
@@ -218,15 +217,15 @@ pub fn main() {
218217
.expect("manifest path could not be canonicalized")
219218
});
220219

221-
let packages = if std::env::args().any(|a| a == "--all" ) {
220+
let packages = if std::env::args().any(|a| a == "--all") {
222221
metadata.packages
223222
} else {
224223
let package_index = {
225224
if let Some(manifest_path) = manifest_path {
226225
metadata.packages.iter().position(|package| {
227-
let package_manifest_path = Path::new(&package.manifest_path).canonicalize().expect(
228-
"package manifest path could not be canonicalized",
229-
);
226+
let package_manifest_path = Path::new(&package.manifest_path)
227+
.canonicalize()
228+
.expect("package manifest path could not be canonicalized");
230229
package_manifest_path == manifest_path
231230
})
232231
} else {
@@ -261,9 +260,9 @@ pub fn main() {
261260
// code
262261
// the call to `cargo_metadata::metadata` must have succeeded. So it's okay to
263262
// unwrap the current path's parent.
264-
current_path = current_path.parent().unwrap_or_else(|| {
265-
panic!("could not find parent of path {}", current_path.display())
266-
});
263+
current_path = current_path
264+
.parent()
265+
.unwrap_or_else(|| panic!("could not find parent of path {}", current_path.display()));
267266
}
268267
}
269268
}
@@ -276,7 +275,9 @@ pub fn main() {
276275
let manifest_path = package.manifest_path;
277276

278277
for target in package.targets {
279-
let args = std::env::args().skip(2).filter(|a| a != "--all" && !a.starts_with("--manifest-path="));
278+
let args = std::env::args()
279+
.skip(2)
280+
.filter(|a| a != "--all" && !a.starts_with("--manifest-path="));
280281

281282
let args = std::iter::once(format!("--manifest-path={}", manifest_path)).chain(args);
282283
if let Some(first) = target.kind.get(0) {
@@ -289,8 +290,7 @@ pub fn main() {
289290
vec![format!("--{}", first), target.name]
290291
.into_iter()
291292
.chain(args),
292-
)
293-
{
293+
) {
294294
std::process::exit(code);
295295
}
296296
}

0 commit comments

Comments
 (0)