1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

inline the usage of nix::readDirectory

`nix::readDirectory` is removed. `std::filesystem::directory_iterator`
is used directly in places that used this util.
This commit is contained in:
siddhantCodes 2024-05-12 17:42:18 +05:30
parent 87ab3c0ea4
commit 1db7d1b840
18 changed files with 26 additions and 44 deletions

View file

@ -259,7 +259,7 @@ StringSet NixRepl::completePrefix(const std::string & prefix)
try {
auto dir = std::string(cur, 0, slash);
auto prefix2 = std::string(cur, slash + 1);
for (auto & entry : readDirectory(dir == "" ? "/" : dir)) {
for (auto & entry : std::filesystem::directory_iterator{dir == "" ? "/" : dir}) {
auto name = entry.path().filename().string();
if (name[0] != '.' && hasPrefix(name, prefix2))
completions.insert(prev + entry.path().string());