From 20b0599cb30a11de7f6c9ce39fbf9c731ac3476e Mon Sep 17 00:00:00 2001 From: Ricardo Sansores Date: Sat, 24 Oct 2026 12:10:22 -0600 Subject: [PATCH] feat(lint)!: exempt From<_> for Element, the widget idiom A UI toolkit such as iced lets a component sit in a layout through `impl From for Element`, so a design system has one per component and an allowlist had to grow with every new one. From into a type named Element is a widget becoming what a view returns, not a data mapping: it is exempt, like the *Error conversions. Into and From are still flagged. Breaking for an allowlist that listed these impls: its entries are now stale and fail the run until removed. magic_map_lint 0.5.0. --- Cargo.lock | 2 +- README.md | 6 +++- magic_map_lint/Cargo.toml | 2 +- magic_map_lint/src/main.rs | 67 ++++++++++++++++++++++++++++++++++++-- 4 files changed, 72 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 45ef039..ab831f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -493,7 +493,7 @@ dependencies = [ [[package]] name = "magic_map_lint" -version = "0.4.0" +version = "0.5.0" dependencies = [ "proc-macro2", "syn 2.0.117", diff --git a/README.md b/README.md index 230595a..588ba6e 100644 --- a/README.md +++ b/README.md @@ -814,11 +814,15 @@ magic-map-lint --allow .magic-map-allow src/ crates/ ``` It walks the given paths and flags every `impl From / Into / TryFrom / -TryInto`, with two deliberate exemptions: +TryInto`, with three deliberate exemptions: - **Error conversions.** `impl From for ApiError` is how `?` bubbles between layers; an impl where either side's type name ends in `Error` is not a data mapping. +- **Widget conversions.** `impl From