mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Improve two error messages
This commit is contained in:
parent
e51522ab3d
commit
b381fdb71e
@ -395,7 +395,7 @@ impl<'de> de::Deserialize<'de> for TomlOptLevel {
|
|||||||
Ok(TomlOptLevel(value.to_string()))
|
Ok(TomlOptLevel(value.to_string()))
|
||||||
} else {
|
} else {
|
||||||
Err(E::custom(format!(
|
Err(E::custom(format!(
|
||||||
"must be an integer, `z`, or `s`, \
|
"must be `0`, `1`, `2`, `3`, `s` or `z`, \
|
||||||
but found the string: \"{}\"",
|
but found the string: \"{}\"",
|
||||||
value
|
value
|
||||||
)))
|
)))
|
||||||
@ -553,7 +553,7 @@ impl TomlProfile {
|
|||||||
if let Some(panic) = &self.panic {
|
if let Some(panic) = &self.panic {
|
||||||
if panic != "unwind" && panic != "abort" {
|
if panic != "unwind" && panic != "abort" {
|
||||||
bail!(
|
bail!(
|
||||||
"`panic` setting of `{}` is not a valid setting,\
|
"`panic` setting of `{}` is not a valid setting, \
|
||||||
must be `unwind` or `abort`",
|
must be `unwind` or `abort`",
|
||||||
panic
|
panic
|
||||||
);
|
);
|
||||||
|
@ -583,7 +583,7 @@ opt-level = 'foo'
|
|||||||
error in [..]/.cargo/config: could not load config key `profile.dev.opt-level`
|
error in [..]/.cargo/config: could not load config key `profile.dev.opt-level`
|
||||||
|
|
||||||
Caused by:
|
Caused by:
|
||||||
must be an integer, `z`, or `s`, but found the string: \"foo\"",
|
must be `0`, `1`, `2`, `3`, `s` or `z`, but found the string: \"foo\"",
|
||||||
);
|
);
|
||||||
|
|
||||||
let config = ConfigBuilder::new()
|
let config = ConfigBuilder::new()
|
||||||
@ -596,7 +596,7 @@ Caused by:
|
|||||||
error in environment variable `CARGO_PROFILE_DEV_OPT_LEVEL`: could not load config key `profile.dev.opt-level`
|
error in environment variable `CARGO_PROFILE_DEV_OPT_LEVEL`: could not load config key `profile.dev.opt-level`
|
||||||
|
|
||||||
Caused by:
|
Caused by:
|
||||||
must be an integer, `z`, or `s`, but found the string: \"asdf\"",
|
must be `0`, `1`, `2`, `3`, `s` or `z`, but found the string: \"asdf\"",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user