From b381fdb71e45de0d0d3786bd68a4c461d677eff7 Mon Sep 17 00:00:00 2001 From: r00ster91 Date: Mon, 10 May 2021 17:28:19 +0200 Subject: [PATCH] Improve two error messages --- src/cargo/util/toml/mod.rs | 4 ++-- tests/testsuite/config.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index 28c313baff9..5ceb19a636e 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -395,7 +395,7 @@ impl<'de> de::Deserialize<'de> for TomlOptLevel { Ok(TomlOptLevel(value.to_string())) } else { Err(E::custom(format!( - "must be an integer, `z`, or `s`, \ + "must be `0`, `1`, `2`, `3`, `s` or `z`, \ but found the string: \"{}\"", value ))) @@ -553,7 +553,7 @@ impl TomlProfile { if let Some(panic) = &self.panic { if panic != "unwind" && panic != "abort" { bail!( - "`panic` setting of `{}` is not a valid setting,\ + "`panic` setting of `{}` is not a valid setting, \ must be `unwind` or `abort`", panic ); diff --git a/tests/testsuite/config.rs b/tests/testsuite/config.rs index 75308ab5a3f..e066a7927da 100644 --- a/tests/testsuite/config.rs +++ b/tests/testsuite/config.rs @@ -583,7 +583,7 @@ opt-level = 'foo' error in [..]/.cargo/config: could not load config key `profile.dev.opt-level` 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() @@ -596,7 +596,7 @@ Caused by: error in environment variable `CARGO_PROFILE_DEV_OPT_LEVEL`: could not load config key `profile.dev.opt-level` 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\"", ); }