From d36041cd7066ff562adb534911a0474826e23ad4 Mon Sep 17 00:00:00 2001 From: Martin Kalcher Date: Thu, 4 Jul 2024 10:48:55 +0200 Subject: [PATCH] Update mrml to 4.0.1 (#16) * mrml 4.0.1 * adjust to new mrml api --- Cargo.lock | 104 +++++++++++++++++++++++++------------------- ext/mrml/Cargo.toml | 2 +- ext/mrml/src/lib.rs | 4 +- 3 files changed, 63 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index be66d86..8849d1b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,13 +30,13 @@ dependencies = [ "bitflags", "cexpr", "clang-sys", - "itertools", + "itertools 0.12.1", "lazy_static", "lazycell", "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.68", ] @@ -114,6 +114,30 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "enum-as-inner" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.68", +] + +[[package]] +name = "enum_dispatch" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -138,6 +162,12 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "ident_case" version = "1.0.1" @@ -164,6 +194,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -237,38 +276,29 @@ name = "mrml" version = "0.1.0" dependencies = [ "magnus", - "mrml 3.1.5", + "mrml 4.0.1", "serde", "serde_json", ] [[package]] name = "mrml" -version = "3.1.5" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed4c5f1e193a156a026c7e899b45b70b1499d887260f66ee40de60be0619e103" +checksum = "6a5fb21b06edad8397bd7e0e6dcef12013b33e979e3ae14f126899ba524f491e" dependencies = [ + "enum-as-inner", + "enum_dispatch", "indexmap", - "itertools", + "itertools 0.13.0", "mrml-json-macros", - "mrml-macros", - "mrml-print-macros", - "rustc-hash", + "rustc-hash 2.0.0", "serde", "serde_json", "thiserror", "xmlparser", ] -[[package]] -name = "mrml-common-macros" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b99915c25e2b56916308ccd9ca090cb0759226271e5f3b8101e7bbdf7fb8d35" -dependencies = [ - "syn 2.0.68", -] - [[package]] name = "mrml-json-macros" version = "0.1.4" @@ -282,32 +312,6 @@ dependencies = [ "syn 2.0.68", ] -[[package]] -name = "mrml-macros" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8abcf8dc56a7e0b082804f65ab6d3f542e6c93d1335053cd4ce7c4731f60494" -dependencies = [ - "Inflector", - "mrml-common-macros", - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "mrml-print-macros" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd30130cb664b15c3134644fa99bc02cd9720d44b3853e47c68f662fcbcf81a1" -dependencies = [ - "darling", - "mrml-common-macros", - "proc-macro2", - "quote", - "syn 2.0.68", -] - [[package]] name = "nom" version = "7.1.3" @@ -318,6 +322,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + [[package]] name = "proc-macro2" version = "1.0.86" @@ -401,6 +411,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "ryu" version = "1.0.18" diff --git a/ext/mrml/Cargo.toml b/ext/mrml/Cargo.toml index 1c93470..04478fc 100644 --- a/ext/mrml/Cargo.toml +++ b/ext/mrml/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Jonian Guveli "] edition = "2018" [dependencies] -mrml = "3.0" +mrml = "4.0" magnus = "0.5" [dependencies.serde] diff --git a/ext/mrml/src/lib.rs b/ext/mrml/src/lib.rs index 2446773..ae0b3d7 100644 --- a/ext/mrml/src/lib.rs +++ b/ext/mrml/src/lib.rs @@ -5,7 +5,7 @@ use magnus::{ }; use mrml::mjml::Mjml; -use mrml::prelude::print::Print; +use mrml::prelude::print::Printable; use mrml::prelude::render::RenderOptions; fn mrml_error() -> ExceptionClass { @@ -51,7 +51,7 @@ impl Template { } fn to_mjml(&self) -> String { - self.res.dense_print() + self.res.print_dense().unwrap() } fn to_json(&self) -> Result {