1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! For comparing strings and slices at compile-time.

#![no_std]

#[macro_use]
mod macros;

#[doc(hidden)]
pub mod __for_cmp_impls;

// pub mod other;

pub mod polymorphism;

#[cfg(feature = "primitives")]
pub mod primitive;

#[cfg(feature = "range")]
pub mod range;

#[cfg(feature = "nonzero")]
pub mod nonzero;

#[cfg(feature = "other")]
pub mod other;

#[cfg(feature = "str")]
__declare_string_cmp_fns! {
    import_path = "const_cmp",
    equality_fn = eq_str,
    ordering_fn = cmp_str,
    ordering_fn_inner = cmp_str_inner,
}

#[cfg(all(feature = "str", feature = "option"))]
__declare_fns_with_docs! {
    (Option<&'a str>, (eq_option_str, cmp_option_str))

    docs(default)

    macro = __impl_option_cmp_fns!(
        for['a,]

        params(l, r)
        eq_comparison = crate::polymorphism::CmpWrapper(l).const_eq(r),
        cmp_comparison = crate::polymorphism::CmpWrapper(l).const_cmp(r),
        parameter_copyability = copy,
    ),
}

/// Functions for comparing slices
#[cfg(feature = "slice")]
pub mod slice;

#[doc(hidden)]
pub mod __ {
    pub use core::cmp::Ordering::{self, Equal, Greater, Less};
    pub use core::matches;

    pub use crate::__for_cmp_impls::U8Ordering;

    pub use crate::polymorphism::{
        CmpWrapper, ConstCmpMarker, IsAConstCmpMarker, IsNotStdKind, IsStdKind,
    };
}