fix(toml): Remove redundant error messages

This commit is contained in:
Ed Page 2023-08-24 16:19:09 -05:00
parent 0c51462864
commit 5cac7aa8c6
9 changed files with 1 additions and 41 deletions

View File

@ -194,8 +194,7 @@ fn read_manifest_from_str(
pub fn parse_document(toml: &str, _file: &Path, _config: &Config) -> CargoResult<toml::Table> {
// At the moment, no compatibility checks are needed.
toml.parse()
.map_err(|e| anyhow::Error::from(e).context("could not parse input as TOML"))
toml.parse().map_err(Into::into)
}
/// Warn about paths that have been deprecated and may conflict.

View File

@ -171,9 +171,6 @@ fn invalid_global_config() {
Caused by:
could not parse TOML configuration in `[..]`
Caused by:
could not parse input as TOML
Caused by:
TOML parse error at line 1, column 2
|
@ -448,9 +445,6 @@ fn malformed_override() {
"\
[ERROR] failed to parse manifest at `[..]`
Caused by:
could not parse input as TOML
Caused by:
TOML parse error at line 8, column 27
|
@ -803,9 +797,6 @@ error: could not load Cargo configuration
Caused by:
could not parse TOML configuration in `[..]`
Caused by:
could not parse input as TOML
Caused by:
TOML parse error at line 1, column 7
|

View File

@ -258,9 +258,6 @@ fn cargo_compile_with_invalid_manifest2() {
"\
[ERROR] failed to parse manifest at `[..]`
Caused by:
could not parse input as TOML
Caused by:
TOML parse error at line 3, column 23
|
@ -283,9 +280,6 @@ fn cargo_compile_with_invalid_manifest3() {
"\
[ERROR] failed to parse manifest at `[..]`
Caused by:
could not parse input as TOML
Caused by:
TOML parse error at line 1, column 5
|
@ -3035,9 +3029,6 @@ fn bad_cargo_config() {
Caused by:
could not parse TOML configuration in `[..]`
Caused by:
could not parse input as TOML
Caused by:
TOML parse error at line 1, column 6
|

View File

@ -1,8 +1,5 @@
error: failed to parse manifest at `[ROOT]/case/Cargo.toml`
Caused by:
could not parse input as TOML
Caused by:
TOML parse error at line 8, column 7
|

View File

@ -52,9 +52,6 @@ fn alias_malformed_config_string() {
Caused by:
could not parse TOML configuration in `[..]/config`
Caused by:
[..]
Caused by:
TOML parse error at line [..]
|

View File

@ -721,9 +721,6 @@ could not load Cargo configuration
Caused by:
could not parse TOML configuration in `[..]/.cargo/config`
Caused by:
could not parse input as TOML
Caused by:
TOML parse error at line 1, column 5
|
@ -1090,9 +1087,6 @@ could not load Cargo configuration
Caused by:
could not parse TOML configuration in `[..]/.cargo/config`
Caused by:
could not parse input as TOML
Caused by:
TOML parse error at line 3, column 1
|

View File

@ -2577,9 +2577,6 @@ Caused by:
Caused by:
failed to parse manifest at `[..]`
Caused by:
could not parse input as TOML
Caused by:
TOML parse error at line 8, column 21
|

View File

@ -1321,9 +1321,6 @@ fn error_malformed_workspace_root() {
"\
[ERROR] failed to parse manifest at `[..]/foo/Cargo.toml`
Caused by:
[..]
Caused by:
[..]
|

View File

@ -1090,9 +1090,6 @@ fn new_warning_with_corrupt_ws() {
failed to parse manifest at `[..]foo/Cargo.toml`
Caused by:
could not parse input as TOML
Caused by:
TOML parse error at line 1, column 5
|