From db0525692dcb94e4f274e033091ad1ce54a30cf3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 20 Nov 2024 21:07:22 +0100 Subject: [PATCH] Formatting --- src/libcmd/command.cc | 36 +++++++++++++++++++----------------- src/libcmd/command.hh | 5 +---- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/libcmd/command.cc b/src/libcmd/command.cc index 0a3a516c2..86d13fab7 100644 --- a/src/libcmd/command.cc +++ b/src/libcmd/command.cc @@ -369,28 +369,30 @@ void MixEnvironment::setEnviron() return; } -void createOutLinks( - const std::filesystem::path & outLink, - const BuiltPaths & buildables, - LocalFSStore & store) +void createOutLinks(const std::filesystem::path & outLink, const BuiltPaths & buildables, LocalFSStore & store) { for (const auto & [_i, buildable] : enumerate(buildables)) { auto i = _i; - std::visit(overloaded { - [&](const BuiltPath::Opaque & bo) { - auto symlink = outLink; - if (i) symlink += fmt("-%d", i); - store.addPermRoot(bo.path, absPath(symlink.string())); - }, - [&](const BuiltPath::Built & bfd) { - for (auto & output : bfd.outputs) { + std::visit( + overloaded{ + [&](const BuiltPath::Opaque & bo) { auto symlink = outLink; - if (i) symlink += fmt("-%d", i); - if (output.first != "out") symlink += fmt("-%s", output.first); - store.addPermRoot(output.second, absPath(symlink.string())); - } + if (i) + symlink += fmt("-%d", i); + store.addPermRoot(bo.path, absPath(symlink.string())); + }, + [&](const BuiltPath::Built & bfd) { + for (auto & output : bfd.outputs) { + auto symlink = outLink; + if (i) + symlink += fmt("-%d", i); + if (output.first != "out") + symlink += fmt("-%s", output.first); + store.addPermRoot(output.second, absPath(symlink.string())); + } + }, }, - }, buildable.raw()); + buildable.raw()); } } diff --git a/src/libcmd/command.hh b/src/libcmd/command.hh index 67c208d28..23529848f 100644 --- a/src/libcmd/command.hh +++ b/src/libcmd/command.hh @@ -372,9 +372,6 @@ void printClosureDiff( * Create symlinks prefixed by `outLink` to the store paths in * `buildables`. */ -void createOutLinks( - const std::filesystem::path & outLink, - const BuiltPaths & buildables, - LocalFSStore & store); +void createOutLinks(const std::filesystem::path & outLink, const BuiltPaths & buildables, LocalFSStore & store); }