fn enabled(directives: &[Directive], level: Level, target: &str) -> bool {
    // Search for the longest match, the vector is assumed to be pre-sorted.
    for directive in directives.iter().rev() {
        match directive.name {
            Some(ref name) if !target.starts_with(&**name) => {}
            Some(..) | None => return level <= directive.level,
        }
    }
    false
}
// Check whether a level and target are enabled by the set of directives.
Check whether a level and target are enabled by the set of directives.
Check whether a level and target are enabled by the set of directives .
fn enabled(directives: &[Directive], level: Level, target: &str) -> bool {
    // Search for the longest match, the vector is assumed to be pre-sorted.
    for directive in directives.iter().rev() {
        match directive.name {
            Some(ref name) if !target.starts_with(&**name) => {}
            Some(..) | None => return level <= directive.level,
        }
    }
    false
}
fn enabled ( directives : & [ Directive ] , level : Level , target : & str ) -> bool { // Search for the longest match, the vector is assumed to be pre-sorted. for directive in directives . iter ( ) . rev ( ) { match directive . name { Some ( ref name ) if ! target . starts_with ( & * * name ) => { } Some ( .. ) | None => return level <= directive . level , } } false }
Check whether a level and target are enabled by the set of directives.
Check whether a level and target are enabled by the set of directives .
directives
&[Directive]
level
Level
target
&str
directives
&[Directive]
level
Level
target
&str