Macro likely_stable::if_unlikely[][src]

macro_rules! if_unlikely {
    ($cond:expr => $e:block) => { ... };
    ($cond:expr => $e:block else $o:block) => { ... };
    (let $v:pat = $cond:expr => $e:block) => { ... };
    (let $v:pat = $cond:expr => $e:block else $o:block) => { ... };
}

If statement which inform the compiler that the first branch will be the most taken branch

It is usefull as a if let statment:

use likely_stable::if_unlikely;
use rand::random;
 
let v = Some(random()).filter(|v:&i32| *v > 10);
 
if_unlikely!{let None = v => {
    println!("unlikely!")
} else {
    println!("likely!")
}};