elio 1.1.0

Snappy, batteries-included terminal file manager with rich previews, inline images, bulk actions, and trash support.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::{fs, io, path::Path};

pub(crate) fn count_directory_items(dir: &Path, show_hidden: bool) -> io::Result<usize> {
    let mut count = 0usize;
    for item in fs::read_dir(dir)? {
        let item = match item {
            Ok(item) => item,
            Err(_) => continue,
        };
        if !show_hidden && super::is_hidden_entry(&item) {
            continue;
        }
        count += 1;
    }
    Ok(count)
}