Coverage Report

Created: 2026-02-26 06:30

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/time-0.3.47/src/hint.rs
Line
Count
Source
1
//! Hints to the compiler that affects how code should be emitted or optimized.
2
3
/// Indicate that a given branch is **not** likely to be taken, relatively speaking.
4
#[inline(always)]
5
#[cold]
6
38.9k
pub(crate) const fn cold_path() {}
7
8
/// Indicate that a given condition is likely to be true.
9
#[inline(always)]
10
36.0k
pub(crate) const fn likely(b: bool) -> bool {
11
36.0k
    if !b {
12
17.2k
        cold_path();
13
18.8k
    }
14
36.0k
    b
15
36.0k
}
16
17
/// Indicate that a given condition is likely to be false.
18
#[inline(always)]
19
44.8k
pub(crate) const fn unlikely(b: bool) -> bool {
20
44.8k
    if b {
21
7.39k
        cold_path();
22
37.4k
    }
23
44.8k
    b
24
44.8k
}