Skip to main content

clamp_depth

Function clamp_depth 

Source
pub fn clamp_depth(requested: usize) -> usize
Expand description

Hold a requested depth inside the range the walk can afford.

A zero would find nothing at all — not even the repository root, which is depth 0 in WalkDir terms but only yields projects because the walk includes it — so it is raised to 1 rather than silently pruning nothing. The ceiling keeps a mistyped scan_depth: 900 from turning a background pass into a full-disk crawl.