mirror of
https://github.com/KumoCorp/kumomta.git
synced 2026-11-17 16:07:41 +00:00
handlebars::Context::wraps serializes its argument with serde_json::to_value, so passing it an existing serde_json::Value deep-copies the whole substitution context a second time. Both Handlebars paths already hold an owned serde_json::Value at that point (render_to_write, and prepare_context which batch injection uses once per recipient), so take ownership of it with Context::from instead. The rendered output is unchanged, and the error case that wraps reported (a serialization failure) cannot occur for a value that is already JSON. --------- Co-authored-by: Akshit Sethi <akshits@adobe.com> Co-authored-by: Wez Furlong <wez@wezfurlong.org>