fn from(filename: &str) -> &'static Syntax<'static> {
        filename
            .rsplit('.')
            .next()
            .and_then(|ext| {
                HLDB.iter()
                    .map(|&s| s)
                    .find(|syn| syn.filematch.contains(&ext))
            })
            .unwrap_or(NO_SYNTAX)
    }
/// Take a filename and find the matching syntax object
///
/// # Return value
/// The first syntax struct in HLDB with a matching extension, or NO_SYNTAX
Take a filename and find the matching syntax object
Take a filename and find the matching syntax object
fn from(filename: &str) -> &'static Syntax<'static> {
        filename
            .rsplit('.')
            .next()
            .and_then(|ext| {
                HLDB.iter()
                    .map(|&s| s)
                    .find(|syn| syn.filematch.contains(&ext))
            })
            .unwrap_or(NO_SYNTAX)
    }
fn from ( filename : & str ) -> & ' static Syntax < ' static > { filename . rsplit ( '.' ) . next ( ) . and_then ( | ext | { HLDB . iter ( ) . map ( | & s | s ) . find ( | syn | syn . filematch . contains ( & ext ) ) } ) . unwrap_or ( NO_SYNTAX ) }
Take a filename and find the matching syntax object
Take a filename and find the matching syntax object
filename
&str
return value
The first syntax struct in HLDB with a matching extension, or NO_SYNTAX
The first syntax struct in HLDB with a matching extension or NO_SYNTAX