Skip to main content

module_key

Function module_key 

Source
pub fn module_key(
    path: &str,
    module_roots: &[String],
    module_depth: usize,
) -> String
Expand description

Compute a module key from an input path.

Rules:

  • Root-level files become "(root)".
  • If the first directory segment is in module_roots, include up to module_depth directory segments.
  • Otherwise, the module key is the first directory segment.