Skip to content

Commit

Permalink
Switch to then_some.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed May 3, 2023
1 parent 4f79ac3 commit b9993bd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/cargo/util/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1694,11 +1694,7 @@ impl Config {
.join(&toolchain)
.join("bin")
.join(&tool_exe);
if toolchain_exe.exists() {
Some(toolchain_exe)
} else {
None
}
toolchain_exe.exists().then_some(toolchain_exe)
})
.unwrap_or_else(|| PathBuf::from(tool_str))
}
Expand Down

0 comments on commit b9993bd

Please sign in to comment.