uom
uom copied to clipboard
Remove unnecessary unit struct fields from `Units` enum variants
The unit struct fields in Units enum variants were never accessed - they were only used for construction and immediately discarded in pattern matching.
Changes:
- Convert tuple-like enum variants (e.g.,
steradian(steradian)) to unit-like variants (e.g.,steradian) - Update pattern matching to use simpler syntax without wildcards
- Update
ALL_UNITSinitialization to use unit-like syntax - Update tests to construct enum variants without passing unit structs
Benefits:
- Simpler, clearer API
- Smaller enum variants (no tuple wrapper)
- Less confusion about unused fields
Breaking change: External code constructing Units enum variants must use unit-like syntax instead of tuple-like syntax.
Fixes #539