feat: re-export taffy crate so users can name taffy types without a separate dependency#191
Merged
Merged
Conversation
Users who implement MeasureFunc need to reference taffy types such as taffy::Size, taffy::AvailableSpace, and taffy::Style directly. Previously this required adding taffy as a separate dependency. Adding pub use taffy lets users access these types via iocraft::taffy::Size etc. without a redundant Cargo dependency. Closes ccbrown#189
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #191 +/- ##
=======================================
Coverage 87.71% 87.71%
=======================================
Files 35 35
Lines 5526 5526
Branches 5526 5526
=======================================
Hits 4847 4847
Misses 570 570
Partials 109 109 🚀 New features to boost your workflow:
|
Owner
|
Thank you! |
Merged
Contributor
Author
|
Thank you for merging! I appreciate the quick review and merge. This makes taffy type handling much more ergonomic for users of iocraft. |
|
Oh neat, thanks! |
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.
Background
While exploring
MeasureFunc, I ran into the problem described in #189 — the callback signature requirestaffy::Size,taffy::AvailableSpace, andtaffy::Style, but none of those types are currently accessible throughiocraft::. Trying to write an implementation like:…forces users to add
taffyseparately toCargo.tomljust to name the return type, which is awkward wheniocraftalready bundles it internally.Change
Following the suggestion in the issue, this PR adds a single line:
to
packages/iocraft/src/lib.rs. Users can now writeiocraft::taffy::Size<f32>instead of depending ontaffydirectly.Testing
The change is a one-line re-export. Existing tests all pass and the
MeasureFunctype signature is unmodified — this purely exposes what was already an internal dependency.