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
Ord::clamp won't be stable until rust-lang/rust#44095 closes and reaches a release. Even then, I don't see the harm in keeping num's function around. num-traits supports pretty old compilers, and it would be annoying to get a deprecation message there that you can't act on yet.
Plus there's support for PartialOrd, however questionable that may be. You've implemented clamp on f32 and f64, but that won't help newtype floats, for instance.
Yeah that's reasonable. My only reason for thinking we should maybe deprecate this is that std's clamp will account for 99% of use cases, and it's nice to unify code "look". Though tbh since this function is unopinionated about the input or output type it's completely harmless to keep around.
rust-lang/rust#58710 was just merged into master. This may be cause to deprecate the
num::clamp
function in the near future.The text was updated successfully, but these errors were encountered: