pub fn resolve_unique_filename(dir: &Path, name: &str) -> PathBufExpand description
Resolve a unique filename in dir, appending -1, -2, etc. on collision.
If dir/name doesn’t exist, returns it as-is. Otherwise increments a
counter on the stem: photo.jpg → photo-1.jpg → photo-2.jpg …