Skip to main content

bound_watch_set

Function bound_watch_set 

Source
pub fn bound_watch_set(
    watches: HashMap<PathBuf, HashSet<String>>,
    active_dir: Option<&Path>,
    cap: usize,
) -> HashMap<PathBuf, HashSet<String>>
Expand description

AR.3: bound a desired watch set to at most cap directories. The active buffer’s directory is always kept (the file you’re looking at must be watched); the remainder fill deterministically (sorted) up to cap. Excess dirs are dropped — their buffers rely on the on-activate stat fallback. Pure, so the cap logic is unit-testable without a filesystem.