pub fn toggle_entries_at(
entries: &mut Vec<FileTreeEntry>,
index: usize,
) -> Result<()>Expand description
Toggle expansion of the directory entry at index (1-based
within entries). Children of newly-expanded directories
are inserted right after the directory’s row at depth + 1;
closing a directory removes every entry whose depth is
strictly greater than the closing one until depth drops
back. No-op for non-directory rows.
Pure function over the entry list – no struct state, no
rope re-render. The App-side caller composes this with
render_to_buffer and a FileTreeEntries buffer-local
write to atomically refresh both halves of the file-tree
representation.