8000 Make the toolchain overriding config hierarchical by rami3l · Pull Request #3492 · rust-lang/rustup · GitHub
[go: up one dir, main page]

Skip to content

Make the toolchain overriding config hierarchical #3492

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

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use iter::successors in find_override_from_dir_walk()
  • Loading branch information
rami3l committed Nov 4, 2023
commit 3f5e2173e427329920a217754230000ccf378dd3
5 changes: 1 addition & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,8 @@ impl Cfg {
settings: &Settings,
) -> Result<Option<(OverrideFile, OverrideReason)>> {
let notify = self.notify_handler.as_ref();
let mut dir = Some(dir);

while let Some(d) = dir {
for d in iter::successors(Some(dir), |d| d.parent()) {
// First check the override database
if let Some(name) = settings.dir_override(d, notify) {
let reason = OverrideReason::OverrideDB(d.to_owned());
Expand Down Expand Up @@ -664,8 +663,6 @@ impl Cfg {
let reason = OverrideReason::ToolchainFile(toolchain_file);
return Ok(Some((override_file, reason)));
}

dir = d.parent();
}

Ok(None)
Expand Down
0