Skip to content

Commit

Permalink
Merge branch 'master' into bump-clap
Browse files Browse the repository at this point in the history
  • Loading branch information
zohnannor committed Feb 11, 2023
2 parents ec6da03 + bb88d62 commit 9a70505
Show file tree
Hide file tree
Showing 61 changed files with 1,457 additions and 160 deletions.
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Expand Up @@ -3,7 +3,10 @@
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Test it: `cargo test`
4. Lint it: `cargo +nightly clippy --all --all-targets -- -D warnings`
4. Lint it: `cargo +beta clippy --all --all-targets -- -D warnings`
> We use `cargo clippy` to ensure high-quality code and to enforce a set of best practices for Rust programming. However, not all lints provided by `cargo clippy` are relevant or applicable to our project.
> We may choose to ignore some lints if they are unstable, experimental, or specific to our project.
> If you are unsure about a lint, please ask us in the [rustup Discord channel](https://discord.com/channels/442252698964721669/463480252723888159).
5. Commit your changes: `git commit -am 'Add some feature'`
6. Push to the branch: `git push origin my-new-feature`
7. Submit a pull request :D
Expand Down
191 changes: 191 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -67,6 +67,7 @@ url = "2.1"
wait-timeout = "0.2"
xz2 = "0.1.3"
zstd = "0.11"
trycmd = "0.14.11"

[dependencies.retry]
default-features = false
Expand Down
8 changes: 4 additions & 4 deletions src/cli/self_update.rs
Expand Up @@ -712,7 +712,7 @@ fn customize_install(mut opts: InstallOpts<'_>) -> Result<InstallOpts<'_>> {
fn install_bins() -> Result<()> {
let bin_path = utils::cargo_home()?.join("bin");
let this_exe_path = utils::current_exe()?;
let rustup_path = bin_path.join(&format!("rustup{EXE_SUFFIX}"));
let rustup_path = bin_path.join(format!("rustup{EXE_SUFFIX}"));

utils::ensure_dir_exists("bin", &bin_path, &|_: Notification<'_>| {})?;
// NB: Even on Linux we can't just copy the new binary over the (running)
Expand Down Expand Up @@ -1088,8 +1088,8 @@ fn parse_new_rustup_version(version: String) -> String {

pub(crate) fn prepare_update() -> Result<Option<PathBuf>> {
let cargo_home = utils::cargo_home()?;
let rustup_path = cargo_home.join(&format!("bin{MAIN_SEPARATOR}rustup{EXE_SUFFIX}"));
let setup_path = cargo_home.join(&format!("bin{MAIN_SEPARATOR}rustup-init{EXE_SUFFIX}"));
let rustup_path = cargo_home.join(format!("bin{MAIN_SEPARATOR}rustup{EXE_SUFFIX}"));
let setup_path = cargo_home.join(format!("bin{MAIN_SEPARATOR}rustup-init{EXE_SUFFIX}"));

if !rustup_path.exists() {
return Err(CLIError::NotSelfInstalled { p: cargo_home }.into());
Expand Down Expand Up @@ -1212,7 +1212,7 @@ pub(crate) fn check_rustup_update() -> Result<()> {

pub(crate) fn cleanup_self_updater() -> Result<()> {
let cargo_home = utils::cargo_home()?;
let setup = cargo_home.join(&format!("bin/rustup-init{EXE_SUFFIX}"));
let setup = cargo_home.join(format!("bin/rustup-init{EXE_SUFFIX}"));

if setup.exists() {
utils::remove_file("setup", &setup)?;
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Expand Up @@ -865,7 +865,7 @@ impl Cfg {

// Filter out toolchains that don't track a release channel
Ok(toolchains
.filter(|&(_, ref t)| t.as_ref().map(Toolchain::is_tracking).unwrap_or(false))
.filter(|(_, ref t)| t.as_ref().map(Toolchain::is_tracking).unwrap_or(false))
.collect())
}

Expand Down
2 changes: 1 addition & 1 deletion src/diskio/mod.rs
Expand Up @@ -342,7 +342,7 @@ pub(crate) fn perform<F: Fn(usize)>(item: &mut Item, chunk_complete_callback: F)
write_file(&item.full_path, contents, item.mode)
}
FileBuffer::Threaded(ref mut contents) => {
write_file(&item.full_path, &contents, item.mode)
write_file(&item.full_path, contents, item.mode)
}
}
}
Expand Down

0 comments on commit 9a70505

Please sign in to comment.