mirror of
https://github.com/rust-lang/cargo
synced 2024-10-13 19:22:33 +00:00
Update wording and use if let
This commit is contained in:
parent
86c6e42741
commit
d3aed3585e
|
@ -572,15 +572,12 @@ impl Config {
|
|||
return;
|
||||
}
|
||||
|
||||
match self.upper_case_env.get(key.as_env_key()) {
|
||||
Some(env_key) => {
|
||||
let _ = self.shell().warn(format!(
|
||||
"Environment variables require uppercase letters, \
|
||||
but the variable: `{}` contains lowercase letters or dashes.",
|
||||
env_key
|
||||
));
|
||||
}
|
||||
None => {}
|
||||
if let Some(env_key) = self.upper_case_env.get(key.as_env_key()) {
|
||||
let _ = self.shell().warn(format!(
|
||||
"Environment variables are expected to use uppercase letters and underscores, \
|
||||
the variable {} will be ignored and have no effect",
|
||||
env_key
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -368,8 +368,8 @@ fn target_in_environment_contains_lower_case() {
|
|||
.env(target_key, "nonexistent-linker")
|
||||
.with_status(101)
|
||||
.with_stderr_contains(format!(
|
||||
"warning: Environment variables require uppercase letters, \
|
||||
but the variable: `{}` contains lowercase letters or dashes.",
|
||||
"warning: Environment variables are expected to use uppercase letters and underscores, \
|
||||
the variable {} will be ignored and have no effect",
|
||||
target_key
|
||||
))
|
||||
.run();
|
||||
|
@ -391,8 +391,8 @@ fn target_in_environment_contains_lower_case_on_windows() {
|
|||
.env(target_key, "nonexistent-linker")
|
||||
.with_status(101)
|
||||
.with_stderr_does_not_contain(format!(
|
||||
"warning: Environment variables require uppercase letters, \
|
||||
but the variable: `{}` contains lowercase letters or dashes.",
|
||||
"warning: Environment variables are expected to use uppercase letters and underscores, \
|
||||
the variable {} will be ignored and have no effect",
|
||||
target_key
|
||||
))
|
||||
.run();
|
||||
|
|
Loading…
Reference in a new issue