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())
}
