[][src]Function rust_code_analysis::get_language_for_file

pub fn get_language_for_file(path: &PathBuf) -> Option<LANG>

Detects the language of a code using the extension of a file.

Examples

use std::path::PathBuf;

use rust_code_analysis::get_language_for_file;

let path = PathBuf::from("build.rs");
get_language_for_file(&path).unwrap();