intrinsics 0.1.0

Safe likely and unlikely intrinsics
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[inline(always)]
#[cold]
pub const fn cold_path() {}

#[inline(always)]
pub const fn likely(b: bool) -> bool {
    if !b { cold_path() }
    b
}

#[inline(always)]
pub const fn unlikely(b: bool) -> bool {
    if b { cold_path() }
    b
}