Skip to content

Move closures in final_layout_pass() to standalone methods #200

@Weibye

Description

@Weibye

What problem does this solve or what need does it fill?

AFAIK closures aren't really suitable for testing, especially when they are stored in local variables. Moving let layout_line = | ... | and let layout_item = | ... | to proper methods would allow them to be tested

Solution

Rework the closures to methods, then add tests to those methods

Additional context

https://github.com/DioxusLabs/taffy/blob/main/src/flexbox.rs#L1343
https://github.com/DioxusLabs/taffy/blob/main/src/flexbox.rs#L1347

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions