pub const fn clamp_const(value: u64, min: u64, max: u64) -> u64Expand description
Clamp value to a range [min, max] - compile-time constant.
ยงExamples
use chie_core::utils::clamp_const;
assert_eq!(clamp_const(5, 0, 10), 5);
assert_eq!(clamp_const(15, 0, 10), 10);
assert_eq!(clamp_const(0, 5, 10), 5);