Skip to content

Commit abc715e

Browse files
committed
run rustfmt on bootstrap/bin folder
1 parent 6dc035e commit abc715e

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

src/bootstrap/bin/rustc.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ fn main() {
3636
let args = env::args_os().skip(1).collect::<Vec<_>>();
3737
// Detect whether or not we're a build script depending on whether --target
3838
// is passed (a bit janky...)
39-
let target = args.windows(2).find(|w| &*w[0] == "--target")
40-
.and_then(|w| w[1].to_str());
39+
let target = args.windows(2)
40+
.find(|w| &*w[0] == "--target")
41+
.and_then(|w| w[1].to_str());
4142
let version = args.iter().find(|w| &**w == "-vV");
4243

4344
// Build scripts always use the snapshot compiler which is guaranteed to be
@@ -64,9 +65,10 @@ fn main() {
6465

6566
let mut cmd = Command::new(rustc);
6667
cmd.args(&args)
67-
.arg("--cfg").arg(format!("stage{}", stage))
68-
.env(bootstrap::util::dylib_path_var(),
69-
env::join_paths(&dylib_path).unwrap());
68+
.arg("--cfg")
69+
.arg(format!("stage{}", stage))
70+
.env(bootstrap::util::dylib_path_var(),
71+
env::join_paths(&dylib_path).unwrap());
7072

7173
if let Some(target) = target {
7274
// The stage0 compiler has a special sysroot distinct from what we
@@ -101,9 +103,8 @@ fn main() {
101103
// This... is a bit of a hack how we detect this. Ideally this
102104
// information should be encoded in the crate I guess? Would likely
103105
// require an RFC amendment to RFC 1513, however.
104-
let is_panic_abort = args.windows(2).any(|a| {
105-
&*a[0] == "--crate-name" && &*a[1] == "panic_abort"
106-
});
106+
let is_panic_abort = args.windows(2)
107+
.any(|a| &*a[0] == "--crate-name" && &*a[1] == "panic_abort");
107108
if is_panic_abort {
108109
cmd.arg("-C").arg("panic=abort");
109110
}
@@ -114,7 +115,7 @@ fn main() {
114115
cmd.arg("-g");
115116
}
116117
let debug_assertions = match env::var("RUSTC_DEBUG_ASSERTIONS") {
117-
Ok(s) => if s == "true" {"y"} else {"n"},
118+
Ok(s) => if s == "true" { "y" } else { "n" },
118119
Err(..) => "n",
119120
};
120121
cmd.arg("-C").arg(format!("debug-assertions={}", debug_assertions));

src/bootstrap/bin/rustdoc.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ fn main() {
2929

3030
let mut cmd = Command::new(rustdoc);
3131
cmd.args(&args)
32-
.arg("--cfg").arg(format!("stage{}", stage))
33-
.arg("--cfg").arg("dox")
34-
.env(bootstrap::util::dylib_path_var(),
35-
env::join_paths(&dylib_path).unwrap());
32+
.arg("--cfg")
33+
.arg(format!("stage{}", stage))
34+
.arg("--cfg")
35+
.arg("dox")
36+
.env(bootstrap::util::dylib_path_var(),
37+
env::join_paths(&dylib_path).unwrap());
3638
std::process::exit(match cmd.status() {
3739
Ok(s) => s.code().unwrap_or(1),
3840
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),

0 commit comments

Comments
 (0)