Repository navigation
feat(lint)!: exempt From<_> for Element, the widget idiom - #5
Merged
Merged
Conversation
A UI toolkit such as iced lets a component sit in a layout through `impl From<Component> 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<Element> and From<Element> 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
magic-map-lintflags every hand-writtenFrom/Into/TryFrom/TryInto, with an exemption for error conversions and an allowlist that only shrinks. A UI built on iced has oneimpl From<Component> for Elementper design-system component — the toolkit's idiom forcolumn![Button::new(..)]— so the allowlist of a project with a design system (quickedge: 33 lines today) grows with every component, and a bare type name on that list would also let the same impl through anywhere else.This adds a third exemption beside the
*Errorrule:Frominto a type namedElementis a widget becoming what a view returns, not a data mapping.Into<Element>andFrom<Element>are still flagged.cargo test -p magic_map_lint: 4 pass; clippy clean).… for Elementlines come out stale and nothing else changes; without them the run passes.magic_map_lintgoes to 0.5.0. The README's exemption list is updated.Not published: after merge,
cargo publish -p magic_map_lint, then quickedge bumpsmagic_map_lint_versionand drops the 33 lines.🤖 Generated with Claude Code