You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add constructor functions for each variant of Val (#20518)
# Objective
Add constructor functions for each variant of `Val`
Fixes#15937
## Solution
Add constructor functions for each variant of `Val`.
#
Doc comments feel a bit clumsy, not sure how to rephrase them, maybe
doesn't matter. Perhaps it's not necessary to repeat the enum
documentation either, not sure.
To make `Val`s easier to construct the following helper functions have been added: `px`, `percent`, `vw`, `vh`, `vmin` and `vmax`. Each function takes an `f32` value and returns value wrapped by its corresponding `Val` variant. There is also an `auto` helper function that maps to `Val::Auto`.
0 commit comments