Well `#parent_dirs` returns an Array so calling `#to_set` on `new_files.map{}` does both filter out duplicate directories and return a Set as is expected from `#new_dirs`.
Using `#uniq` would also work though but `#new_dirs` would return an Array.