shows (override) in toolchain list#2312
shows (override) in toolchain list#2312kinnison merged 1 commit intorust-lang:masterfrom bestia-dev:shows_override_in_toolchain_list
Conversation
|
The examples look good, but I'd like to see some tests added to check all the cases (e.g. override by I think the tests probably belong in |
|
I found a similar test in cli-rustup.rs: list_default_toolchain()
|
|
I think OverrideReason is not needed for the #[derive(Debug)]
pub enum OverrideReason {
Environment,
CommandLine,
OverrideDB(PathBuf),
ToolchainFile(PathBuf),
}
impl Display for OverrideReason {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::result::Result<(), fmt::Error> {
match self {
Self::Environment => write!(f, "environment override by RUSTUP_TOOLCHAIN"),
Self::CommandLine => write!(f, "overridden by +toolchain on the command line"),
Self::OverrideDB(path) => write!(f, "directory override for '{}'", path.display()),
Self::ToolchainFile(path) => write!(f, "overridden by '{}'", path.display()),
}
}
} |
|
The real command for getting the details about OverrideReason is this: |
|
This is looking really good. Could you please rebase to squash everything down to one or two neat commits, rather than the formatting nightmare you appear to have had in the middle, and then we should be good to merge. I'm fine with the hint, |
kinnison
left a comment
There was a problem hiding this comment.
Approved modulo rebase/squash cleanup of commits and commit messages.
|
I made the requested changes. Is it now ok to merge? |
|
Looks good 👍 |
This PR is for issue #2295
The command list now shows the override toolchain for this specific directory):