mirl 9.2.0

Miners Rust Lib - A massive collection of ever growing and changing functions, structs, and enums. Check the description for compatibility and toggleable features! (Most of the lib is controlled by flags/features so the lib can continue to be lightweight despite its size)
/// Additional functions for `core::ops::Range` (val..val)
pub const trait RangeExtension<T, F> {
    /// If the range goes from 10 to 20 and a 0.5 is inputted, 15 is returned
    fn get_value_from_percent(&self, percentage: F) -> Option<T>;
    /// If the range goes from 10 to 20 and a 15 is inputted, 0.5 is returned
    fn get_percent_from_value(&self, value: T) -> Option<F>;
}

impl<
        T: [const] crate::extensions::TryIntoPatch<F> + Copy,
        F: [const] crate::extensions::TryIntoPatch<T>
            + [const] core::ops::Mul<Output = F>
            + [const] core::ops::Div<Output = F>
            + [const] crate::extensions::Round
            + Copy,
    > const RangeExtension<T, F> for core::ops::Range<T>
{
    fn get_value_from_percent(&self, percentage: F) -> Option<T> {
        ((self.end.try_into_value()? * percentage).round()).try_into_value()
    }
    fn get_percent_from_value(&self, value: T) -> Option<F> {
        Some((value).try_into_value()? / ((self.end).try_into_value()?))
    }
}