-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shows (override) in toolchain list #2312
shows (override) in toolchain list #2312
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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):