Skip to content

Commit 5f778bb

Browse files
committed
remove setup special-casing in Flags::parse
1 parent 4977726 commit 5f778bb

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/bootstrap/flags.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use getopts::Options;
1010
use crate::builder::{Builder, Kind};
1111
use crate::config::{Config, TargetSelection};
1212
use crate::setup::Profile;
13-
use crate::util::t;
1413
use crate::{Build, DocTests};
1514

1615
#[derive(Copy, Clone)]
@@ -544,7 +543,7 @@ Arguments:
544543
Kind::Bench | Kind::Clean | Kind::Dist | Kind::Install => {}
545544
};
546545
// Get any optional paths which occur after the subcommand
547-
let mut paths = matches.free[1..].iter().map(|p| p.into()).collect::<Vec<PathBuf>>();
546+
let paths = matches.free[1..].iter().map(|p| p.into()).collect::<Vec<PathBuf>>();
548547

549548
let verbose = matches.opt_present("verbose");
550549

@@ -616,7 +615,7 @@ Arguments:
616615
Subcommand::Run { paths }
617616
}
618617
Kind::Setup => {
619-
let profile = if paths.len() > 1 {
618+
if paths.len() > 1 {
620619
println!("\nat most one profile can be passed to setup\n");
621620
usage(1, &opts, verbose, &subcommand_help)
622621
} else if let Some(path) = paths.pop() {

src/bootstrap/setup.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ impl fmt::Display for Profile {
8888

8989
impl Step for Profile {
9090
type Output = ();
91+
const DEFAULT: bool = true;
9192

9293
fn should_run(mut run: ShouldRun<'_>) -> ShouldRun<'_> {
9394
for choice in Profile::all() {
@@ -140,9 +141,7 @@ pub fn setup(config: &Config, profile: Profile) {
140141
profile, VERSION
141142
);
142143

143-
if !config.dry_run {
144-
t!(fs::write(path, settings));
145-
}
144+
t!(fs::write(path, settings));
146145

147146
let include_path = profile.include_path(&config.src);
148147
println!("`x.py` will now use the configuration at {}", include_path.display());

0 commit comments

Comments
 (0)