From f92ec48c9257ff8d67df1eb8e942a2c25cf2ba91 Mon Sep 17 00:00:00 2001 From: Rune Soerensen Date: Thu, 25 Apr 2024 13:29:27 -0400 Subject: [PATCH] Use type that is mapped to ParseChangelogErrorInternal::Markdown (#4) The value of the error being mapped here https://github.com/heroku/keep_a_changelog/blob/c4d62b03052a0fd5f17424fcad4c646abae01d31/src/changelog.rs#L270 isn't a String anymore, which causes compilation errors. The default behavior of the `markdown` crate was changed in https://github.com/wooorm/markdown-rs/commit/3dc7f1a37e8831f82c1a71dc3c8d14290088f1c9. Alternative solution would be pinning the `markdown` crate to version [1.0.0-alpha.16](https://github.com/wooorm/markdown-rs/releases/tag/1.0.0-alpha.16). Seems like it might be a good idea to pin the version in any case though (considering breaking changes are introduced like this?) --- Cargo.toml | 2 +- src/changelog.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 20c2f00..7d1d7e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ rust-version = "1.74" chrono = "0.4" indexmap = "2" lazy_static = "1" -markdown = "1.0.0-alpha.14" +markdown = "=1.0.0-alpha.17" regex = "1" semver = "1" thiserror = "1" diff --git a/src/changelog.rs b/src/changelog.rs index d1ba2e8..913509c 100644 --- a/src/changelog.rs +++ b/src/changelog.rs @@ -210,7 +210,7 @@ pub struct ParseChangelogError(#[from] ParseChangelogErrorInternal); #[derive(Debug, Error)] enum ParseChangelogErrorInternal { #[error("Could not parse changelog as markdown\nError: {0}")] - Markdown(String), + Markdown(markdown::message::Message), #[error("Could not parse change group type from changelog - {0}\nError: {1}")] InvalidChangeGroup(String, #[source] ParseChangeGroupError),