dsc 0.1.3

dsc is a cli tool for finding and removing duplicate files on one or multiple file systems, while respecting your gitignore rules.
1
2
3
4
5
6
7
use std::path::Path;

// Path::is_dir() is not guaranteed to be intuitively correct for "." and ".."
// See: https://github.com/rust-lang/rust/issues/45302
pub fn is_valid_path(path: &Path) -> bool {
    (path.is_file() || path.is_dir()) && (path.file_name().is_some() || path.canonicalize().is_ok())
}