Skip to content

Commit 176217a

Browse files
authored
Merge pull request #98 from chrissimpkins/cargo-default
Convert to default installation of cargo and replace `--with-cargo` option with `--without-cargo` option
2 parents 513cbaf + 2b7088c commit 176217a

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ struct Opts {
9393
)]
9494
preserve_target: bool,
9595

96-
#[structopt(
97-
long = "with-cargo",
98-
help = "Download cargo [default: installed cargo]"
99-
)]
100-
with_cargo: bool,
101-
10296
#[structopt(long = "with-src", help = "Download rust-src [default: no download]")]
10397
with_src: bool,
10498

@@ -157,6 +151,12 @@ struct Opts {
157151
parse(from_os_str)
158152
)]
159153
script: Option<PathBuf>,
154+
155+
#[structopt(
156+
long = "without-cargo",
157+
help = "Do not install cargo [default: install cargo]"
158+
)]
159+
without_cargo: bool,
160160
}
161161

162162
pub type GitDate = Date<Utc>;

src/toolchains.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,11 @@ impl Toolchain {
231231
.map_err(InstallError::Download)?;
232232
}
233233

234-
if dl_params.install_cargo {
234+
// download cargo by default
235+
// deactivate with the `--without-cargo` flag
236+
// this default behavior was changed as of v0.6.0
237+
// see: https://github.com/rust-lang/cargo-bisect-rustc/issues/81
238+
if !dl_params.without_cargo {
235239
let filename = format!("cargo-nightly-{}", self.host);
236240
download_tarball(
237241
&client,
@@ -407,8 +411,8 @@ pub(crate) struct DownloadParams {
407411
url_prefix: String,
408412
tmp_dir: PathBuf,
409413
install_dir: PathBuf,
410-
install_cargo: bool,
411414
install_src: bool,
415+
without_cargo: bool,
412416
force_install: bool,
413417
}
414418

@@ -432,8 +436,8 @@ impl DownloadParams {
432436
url_prefix,
433437
tmp_dir: cfg.rustup_tmp_path.clone(),
434438
install_dir: cfg.toolchains_path.clone(),
435-
install_cargo: cfg.args.with_cargo,
436439
install_src: cfg.args.with_src,
440+
without_cargo: cfg.args.without_cargo,
437441
force_install: cfg.args.force_install,
438442
}
439443
}

0 commit comments

Comments
 (0)