Skip to content

Commit e0aa8fc

Browse files
committed
refactor: rename to env_def more clarity
1 parent 969a052 commit e0aa8fc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/cargo/util/context/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,11 +1043,11 @@ impl GlobalContext {
10431043
output.clear();
10441044
}
10451045

1046-
let def = Definition::Environment(key.as_env_key().to_string());
1046+
let env_def = Definition::Environment(key.as_env_key().to_string());
10471047
if self.cli_unstable().advanced_env && env_val.starts_with('[') && env_val.ends_with(']') {
10481048
// Parse an environment string as a TOML array.
10491049
let toml_v = env_val.parse::<toml::Value>().map_err(|e| {
1050-
ConfigError::new(format!("could not parse TOML list: {}", e), def.clone())
1050+
ConfigError::new(format!("could not parse TOML list: {}", e), env_def.clone())
10511051
})?;
10521052
let values = toml_v.as_array().expect("env var was not array");
10531053
for value in values {
@@ -1056,16 +1056,16 @@ impl GlobalContext {
10561056
let s = value.as_str().ok_or_else(|| {
10571057
ConfigError::new(
10581058
format!("expected string, found {}", value.type_str()),
1059-
def.clone(),
1059+
env_def.clone(),
10601060
)
10611061
})?;
1062-
output.push(CV::String(s.to_string(), def.clone()))
1062+
output.push(CV::String(s.to_string(), env_def.clone()))
10631063
}
10641064
} else {
10651065
output.extend(
10661066
env_val
10671067
.split_whitespace()
1068-
.map(|s| CV::String(s.to_string(), def.clone())),
1068+
.map(|s| CV::String(s.to_string(), env_def.clone())),
10691069
);
10701070
}
10711071
output.sort_by(|a, b| a.definition().cmp(b.definition()));

0 commit comments

Comments
 (0)