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
#![macro_use]
#![allow(unused_macros)]

macro_rules! clip {
    ($lb:expr, $x:expr, $ub:expr) => {{
        $lb.max($ub.min($x))
    }};
}

macro_rules! import_all {
    ($module:ident) => {
        mod $module;
        pub use self::$module::*;
    };
}

macro_rules! impl_union_intersect {
    ($type:ty, $build:expr) => {
        impl Union for $type {
            fn union(self, _: &$type) -> Self {
                self
            }
        }

        impl Intersection for $type {
            fn intersect(self, _: &$type) -> Self {
                self
            }
        }
    }
}