pub fn from_path<P: AsRef<Path>>(path: P) -> Option<Language> {
        match path.as_ref().extension() {
            Some(v) => v.to_str().and_then(|x| Language::from_str(x).ok()),
            None => Some(Language::Sh),
        }
    }
/// Given a path with file extension, calculate its language
Given a path with file extension, calculate its language
Given a path with file extension calculate its language
pub fn from_path<P: AsRef<Path>>(path: P) -> Option<Language> {
        match path.as_ref().extension() {
            Some(v) => v.to_str().and_then(|x| Language::from_str(x).ok()),
            None => Some(Language::Sh),
        }
    }
pub fn from_path < P : AsRef < Path > > ( path : P ) -> Option < Language > { match path . as_ref ( ) . extension ( ) { Some ( v ) => v . to_str ( ) . and_then ( | x | Language :: from_str ( x ) . ok ( ) ) , None => Some ( Language :: Sh ) , } }
Given a path with file extension, calculate its language
Given a path with file extension calculate its language
path
P
path
P