forked from slint-ui/slint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Live-preview: Prospective fix for panic when moving a component
We were trying to convert a node to a wrong kind of node. Then of course it didn't have the expected children In debug mode you'd have ``` assertion `left == right` failed left: SubElement right: Component ``` from the debug_assert! in `$Node::from` I changed the call to `.into` to a call to `$Node::new` that return an option. Also made the debug_assert into an assert and added track_caller so such problem are easier to debug in the future. (Retrospectively, we probably shouldn't have derived From for $Node) Fix slint-ui#5642 The change contains no tests because the is_recursive_inclusion function is currently not tested and would need some effort to create a test
- Loading branch information
Showing
2 changed files
with
15 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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