From b8a0e9a9b8f0499502d317b7424f6b59fd8b48fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophane=20Hufschmitt?= Date: Fri, 13 Jan 2023 11:05:19 +0100 Subject: [PATCH] Move the `getBuildLog` implementation to its own implementation file Keep the header minimal and clean --- src/libstore/log-store.cc | 12 ++++++++++++ src/libstore/log-store.hh | 7 +------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 src/libstore/log-store.cc diff --git a/src/libstore/log-store.cc b/src/libstore/log-store.cc new file mode 100644 index 000000000..8a26832ab --- /dev/null +++ b/src/libstore/log-store.cc @@ -0,0 +1,12 @@ +#include "log-store.hh" + +namespace nix { + +std::optional LogStore::getBuildLog(const StorePath & path) { + auto maybePath = getBuildDerivationPath(path); + if (!maybePath) + return std::nullopt; + return getBuildLogExact(maybePath.value()); +} + +} diff --git a/src/libstore/log-store.hh b/src/libstore/log-store.hh index b807e3e71..e4d95bab6 100644 --- a/src/libstore/log-store.hh +++ b/src/libstore/log-store.hh @@ -11,12 +11,7 @@ struct LogStore : public virtual Store /* Return the build log of the specified store path, if available, or null otherwise. */ - std::optional getBuildLog(const StorePath & path) { - auto maybePath = getBuildDerivationPath(path); - if (!maybePath) - return std::nullopt; - return getBuildLogExact(maybePath.value()); - } + std::optional getBuildLog(const StorePath & path); virtual std::optional getBuildLogExact(const StorePath & path) = 0;