-
Notifications
You must be signed in to change notification settings - Fork 181
Enforce values that must not be negative at a type level #207
Copy link
Copy link
Open
Labels
good first issueGood for newcomersGood for newcomersusabilityMake the library more comfortable to useMake the library more comfortable to use
Description
What problem does this solve or what need does it fill?
Some values, such as flex_grow and flex_shrink, must not be negative, but are stored as a simple f32.
Documentation is a poor way to enforce this sort of constraint in Rust.
What solution would you like?
Use a non-negative float wrapper type. We can either hand-write this. or reuse an existing crate's work if something suitable exists.
Additional context
Noticed due to #206.
We should keep an eye out for other values that are similarly bounded as part of these changes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersusabilityMake the library more comfortable to useMake the library more comfortable to use