Skip to content

Commit cfb2230

Browse files
committed
refactor(gctx): move paths overrides out from ConfigValue method section
1 parent 9031c50 commit cfb2230

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/cargo/util/context/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -986,17 +986,6 @@ impl GlobalContext {
986986
}
987987
}
988988

989-
/// Get the `paths` overrides config value.
990-
pub fn paths_overrides(&self) -> CargoResult<OptValue<Vec<(String, Definition)>>> {
991-
let key = ConfigKey::from_str("paths");
992-
// paths overrides cannot be set via env config, so use get_cv here.
993-
match self.get_cv(&key)? {
994-
Some(CV::List(val, definition)) => Ok(Some(Value { val, definition })),
995-
Some(val) => self.expected("list", &key, &val),
996-
None => Ok(None),
997-
}
998-
}
999-
1000989
/// Internal method for getting an environment variable as a list.
1001990
/// If the key is a non-mergeable list and a value is found in the environment, existing values are cleared.
1002991
fn get_env_list(
@@ -1777,6 +1766,17 @@ impl GlobalContext {
17771766
.unwrap_or_else(|| PathBuf::from(tool_str))
17781767
}
17791768

1769+
/// Get the `paths` overrides config value.
1770+
pub fn paths_overrides(&self) -> CargoResult<OptValue<Vec<(String, Definition)>>> {
1771+
let key = ConfigKey::from_str("paths");
1772+
// paths overrides cannot be set via env config, so use get_cv here.
1773+
match self.get_cv(&key)? {
1774+
Some(CV::List(val, definition)) => Ok(Some(Value { val, definition })),
1775+
Some(val) => self.expected("list", &key, &val),
1776+
None => Ok(None),
1777+
}
1778+
}
1779+
17801780
pub fn jobserver_from_env(&self) -> Option<&jobserver::Client> {
17811781
self.jobserver.as_ref()
17821782
}

0 commit comments

Comments
 (0)