get_depth

Function get_depth 

Source
pub fn get_depth(patterns: &[&str], depth: Option<usize>) -> usize
Expand description

Computes the maximum depth required for a set of glob patterns.

Logic:

  1. If a depth is provided via the argument, it is returned directly.
  2. Otherwise, if any pattern contains “**”, returns TOP_MAX_DEPTH.
  3. Else, calculates the maximum folder level from patterns (using the folder count), regardless if they contain a single “*” or only “/”.

Returns at least 1.