fn lookup<T>(codepoint: u32, table: &[(u32, u32, T)]) -> T
where
    T: Default + BlockSize + Eq + Copy,
{
    table
        .binary_search_by(|&(start, end, _)| {
            if codepoint < start {
                Ordering::Greater
            } else if codepoint > end {
                Ordering::Less
            } else {
                Ordering::Equal
            }
        })
        .ok()
        .map(|idx| table[idx].2)
        .unwrap_or_default()
}
/// Lookup this code point in `table`
Lookup this code point in `table`
Lookup this code point in ` table `
fn lookup<T>(codepoint: u32, table: &[(u32, u32, T)]) -> T
where
    T: Default + BlockSize + Eq + Copy,
{
    table
        .binary_search_by(|&(start, end, _)| {
            if codepoint < start {
                Ordering::Greater
            } else if codepoint > end {
                Ordering::Less
            } else {
                Ordering::Equal
            }
        })
        .ok()
        .map(|idx| table[idx].2)
        .unwrap_or_default()
}
fn lookup < T > ( codepoint : u32 , table : & [ ( u32 , u32 , T ) ] ) -> T where T : Default + BlockSize + Eq + Copy , { table . binary_search_by ( | & ( start , end , _ ) | { if codepoint < start { Ordering :: Greater } else if codepoint > end { Ordering :: Less } else { Ordering :: Equal } } ) . ok ( ) . map ( | idx | table [ idx ] . 2 ) . unwrap_or_default ( ) }
Lookup this code point in `table`
Lookup this code point in ` table `
codepoint
u32
table
&[(u32, u32, T)]