Honestly hoping the RangeBounds trait will eventually get more methods like `.unwrap_or()`. Probably needs to land in stable first though https://doc.rust-lang.org/std/ops/trait.RangeBounds.html …
Or well, I don't know if you intended that exactly. But it instantly reminds me of the glsl method for doing that which takes an lower / upper limit. I think that would be perfect! https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/clamp.xhtml …
-
-
clamping is a mathematical/technical term for restricting a value to a certain range.
-
What's "math"?
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.