diff --git a/src/nix/prefetch.cc b/src/nix/prefetch.cc index 55b8498ef5d..c6e60a53be6 100644 --- a/src/nix/prefetch.cc +++ b/src/nix/prefetch.cc @@ -118,7 +118,7 @@ std::tuple prefetchFile( /* If the archive unpacks to a single file/directory, then use that as the top-level. */ tmpFile = entries->path(); - unsigned fileCount = std::distance(entries, std::filesystem::directory_iterator{}); + auto fileCount = std::distance(entries, std::filesystem::directory_iterator{}); if (fileCount != 1) { /* otherwise, use the directory itself */ tmpFile = unpacked;