Skip to main content

pattern_sort_key

Function pattern_sort_key 

Source
pub fn pattern_sort_key(pattern: &str, depth: usize) -> (u8, usize)
Expand description

Calculate a sort key for a Files pattern.

Returns (priority, depth) where:

  • priority 0: * (always first)
  • priority 1: normal patterns (sorted by depth)
  • priority 2: debian/* patterns (always last, then by depth)

This follows the Debian convention that the * wildcard should be first, and debian/* patterns should be last in debian/copyright Files paragraphs.