Skip to main content

path_file_ext

Function path_file_ext 

Source
pub fn path_file_ext(path: &str) -> Option<&'static str>
Expand description

Returns the lowercased file extension of path as a &'static str.

  • Returns Some(ext) for extensions recognized by language_for_extension (e.g. "rs").
  • Returns Some("other") for paths that have an extension but it is not in the known set.
  • Returns None for paths with no extension or an empty extension.