// "nice" means prefer lowercase and ends with a semicolon
"nice" means prefer lowercase and ends with a semicolon
" nice " means prefer lowercase and ends with a semicolon
fn choose_nice_entity<'a>(options: &[&'a str]) -> &'a str {
    assert!(!options.is_empty());
    let nicest_entity = options
        .iter()
        .find(|entity| ends_with_semicolon(entity) && is_all_lowercase(entity));
    if let Some(entity) = nicest_entity {
        return entity;
    }
    let less_nice_entity = options
        .iter()
        .find(|entity| ends_with_semicolon(entity) && !is_all_caps(entity));
    if let Some(entity) = less_nice_entity {
        return entity;
    }
    let ok_entity = options.iter().find(|entity| ends_with_semicolon(entity));
    if let Some(entity) = ok_entity {
        return entity;
    }
    let no_semi_entity = options.iter().find(|entity| is_all_lowercase(entity));
    if let Some(entity) = no_semi_entity {
        return entity;
    }
    let worst_entity = options.iter().find(|entity| !is_all_caps(entity));
    if let Some(entity) = worst_entity {
        return entity;
    }
    options[0]
}
fn choose_nice_entity < ' a > ( options : & [ & ' a str ] ) -> & ' a str { assert ! ( options is_empty ( ) ) ; let nicest_entity = options . iter ( ) . find ( | entity | ends_with_semicolon ( entity ) && is_all_lowercase ( entity ) ) ; if let Some ( entity ) = nicest_entity { return entity ; } let less_nice_entity = options . iter ( ) . find ( | entity | ends_with_semicolon ( entity ) && ! is_all_caps ( entity ) ) ; if let Some ( entity ) = less_nice_entity { return entity ; } let ok_entity = options . iter ( ) . find ( | entity | ends_with_semicolon ( entity ) ) ; if let Some ( entity ) = ok_entity { return entity ; } let no_semi_entity = options . iter ( ) . find ( | entity | is_all_lowercase ( entity ) ) ; if let Some ( entity ) = no_semi_entity { return entity ; } let worst_entity = options . iter ( ) . find ( | entity | ! is_all_caps ( entity ) ) ; if let Some ( entity ) = worst_entity { return entity ; } options [ 0 ] }
"nice" means prefer lowercase and ends with a semicolon
" nice " means prefer lowercase and ends with a semicolon
options
&[&'a str]