Skip to content

Commit acf3f52

Browse files
committed
miri-script/toolchain: make new_commit logic easier to follow
1 parent fdb5613 commit acf3f52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tools/miri/miri-script/src/commands.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl Command {
178178
.context("Please install rustup-toolchain-install-master by running 'cargo install rustup-toolchain-install-master'")?;
179179
let sh = Shell::new()?;
180180
sh.change_dir(miri_dir()?);
181-
let new_commit = Some(sh.read_file("rust-version")?.trim().to_owned());
181+
let new_commit = sh.read_file("rust-version")?.trim().to_owned();
182182
let current_commit = {
183183
let rustc_info = cmd!(sh, "rustc +miri --version -v").read();
184184
if rustc_info.is_err() {
@@ -193,7 +193,7 @@ impl Command {
193193
}
194194
};
195195
// Check if we already are at that commit.
196-
if current_commit == new_commit {
196+
if current_commit.as_ref() == Some(&new_commit) {
197197
if active_toolchain()? != "miri" {
198198
cmd!(sh, "rustup override set miri").run()?;
199199
}
@@ -202,7 +202,7 @@ impl Command {
202202
// Install and setup new toolchain.
203203
cmd!(sh, "rustup toolchain uninstall miri").run()?;
204204

205-
cmd!(sh, "rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt -c clippy {flags...} -- {new_commit...}").run()?;
205+
cmd!(sh, "rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt -c clippy {flags...} -- {new_commit}").run()?;
206206
cmd!(sh, "rustup override set miri").run()?;
207207
// Cleanup.
208208
cmd!(sh, "cargo clean").run()?;

0 commit comments

Comments
 (0)