From e47e76e79bd5e9f6140c007f53d0e10eb695f8ed Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 9 Sep 2023 16:15:17 +0200 Subject: [PATCH] Update `toml` to latest version --- Cargo.toml | 2 +- src/markdown_deps.rs | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9fccfc5..6cb41b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ pulldown-cmark = { version = "0.9.1", default-features = false, optional = true semver = { version = "1.0.5", optional = true } syn = { version = "2.0.15", default-features = false, features = ["parsing", "printing", "full"], optional = true } proc-macro2 = { version = "1.0.36", default-features = false, features = ["span-locations"], optional = true } -toml = { version = "0.5.8", optional = true } +toml = { version = "0.7.8", optional = true } url = { version = "2.2.2", optional = true } regex = { version = "1.5.4", default-features = false, features = ["std", "unicode"], optional = true } diff --git a/src/markdown_deps.rs b/src/markdown_deps.rs index a47e8af..035bb17 100644 --- a/src/markdown_deps.rs +++ b/src/markdown_deps.rs @@ -37,7 +37,7 @@ fn extract_version_request(pkg_name: &str, block: &str) -> Result { None => Err(format!("no dependency on {}", pkg_name)), } } - Err(err) => Err(format!("TOML parse error: {}", err)), + Err(err) => Err(format!("{}", err)), } } @@ -304,11 +304,7 @@ mod tests { let block = "[dependencies]\n\ foobar = 1.5.8"; let request = extract_version_request("foobar", block); - // toml 0.5.3 returns "found a period at line 2 column 13. - // Update the test when we bump the toml crate dependency. - assert!(request - .unwrap_err() - .contains("TOML parse error: expected newline, found a period at line 2")); + assert!(request.is_err()); } #[test]