Skip to content

refactor(mrml-core): scope the dead_code allow to the render feature - #690

Merged
jdrouet merged 1 commit into
mainfrom
refactor/scope-dead-code-allow
Sep 13, 2026
Merged

jdrouet merged 1 commit into
mainfrom
refactor/scope-dead-code-allow

Conversation

@jdrouet

@jdrouet jdrouet commented Sep 13, 2026

Copy link
Copy Markdown
Owner

mjml/mod.rs opens with a module-wide #![allow(dead_code)]. It turns out to be covering exactly two methods, MjmlAttributes::lang and ::dir, which are only reachable from mjml/render.rs and so look unused whenever the render feature is off.

Gating that impl block with #[cfg(feature = "render")] says the same thing precisely, and lets the blanket allow go. A module-wide allow silences the lint for everything else in the file too, permanently — which is how two methods end up hiding behind a switch that covers the whole module.

Verified with a clean compile under every relevant feature combination, since that is the only way this one shows up:

features warnings
--no-default-features 0
+parse 0
+render 0
+json 0
+print 0
--all-features 0

Tests stay at 621.

Signed-off-by: Jeremie Drouet <jeremie.drouet@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

📈 This is how your metrics evolved 📉


@jdrouet
jdrouet merged commit 1fe7724 into main Sep 13, 2026
18 checks passed
@jdrouet
jdrouet deleted the refactor/scope-dead-code-allow branch September 13, 2026 10:19
@github-actions github-actions Bot mentioned this pull request Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant