Skip to main content

file_path_to_module_name

Function file_path_to_module_name 

Source
pub fn file_path_to_module_name(file_path: &str) -> String
Expand description

Convert a filesystem source path into a likely module name.

Rules:

  1. Strip .pm or .pl suffix
  2. If a lib/ segment exists, use everything after the last lib/
  3. Otherwise, fall back to the file stem