const-zmij 0.1.0

A double-to-string conversion algorithm based on Schubfach and xjb
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use core::ops::RangeInclusive;

pub(crate) struct ConstRange<T>(pub T);

impl ConstRange<RangeInclusive<i32>> {
    /// const version of [`RangeInclusive::contains`]
    #[allow(clippy::trivially_copy_pass_by_ref)]
    #[inline]
    pub(crate) const fn contains(&self, item: &i32) -> bool {
        let Self(this) = self;
        *this.start() <= *item && *item <= *this.end()
    }
}