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
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 = | ... |andlet layout_item = | ... |to proper methods would allow them to be testedSolution
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