summaryrefslogtreecommitdiff
path: root/nix/libutil
diff options
context:
space:
mode:
authorCongcong Kuo <congcong.kuo@gmail.com>2025-05-26 00:49:26 +0800
committerLudovic Courtès <ludo@gnu.org>2025-06-03 15:09:55 +0200
commit4b9d14378fcc3d8dd4eea36b541fe87e198fd7b8 (patch)
tree530ea4ad44c0c1bdd9d4c655627f7f60a8cf5c74 /nix/libutil
parent8a6cf4fad6d6568940286adc4197f37a344d4e5a (diff)
daemon: Remove ‘singleton’ and replace ‘typedef’ with ‘using’ in ‘types.hh’
* nix/libutil/util.hh (singleton): Remove. * nix/libstore/build.cc (DerivationGoal::startBuilder) (SubstitutionGoal::tryNext, SubstitutionGoal::tryToRun) (LocalStore::ensurePath, LocalStore::repairPath): Use normal construction function instead of ‘singleton’. * nix/libstore/local-store.cc (LocalStore::addToStoreFromDump) (LocalStore::addTextToStore, LocalStore::importPath): Likewise. * nix/nix-daemon/nix-daemon.cc (performOp): Likewise. Change-Id: If0d929407c09482f3b506a1c51dfda70e29696dd Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'nix/libutil')
-rw-r--r--nix/libutil/types.hh14
-rw-r--r--nix/libutil/util.hh9
2 files changed, 7 insertions, 16 deletions
diff --git a/nix/libutil/types.hh b/nix/libutil/types.hh
index 160884ee1ad..62889e6fa99 100644
--- a/nix/libutil/types.hh
+++ b/nix/libutil/types.hh
@@ -76,24 +76,24 @@ public:
76}; 76};
77 77
78 78
79typedef list<string> Strings; 79using Strings = std::list<std::string>;
80typedef set<string> StringSet; 80using StringSet = std::set<std::string>;
81 81
82 82
83/* Paths are just strings. */ 83/* Paths are just strings. */
84typedef string Path; 84using Path = std::string;
85typedef list<Path> Paths; 85using Paths = std::list<Path>;
86typedef set<Path> PathSet; 86using PathSet = std::set<Path>;
87 87
88 88
89typedef enum { 89enum Verbosity {
90 lvlError = 0, 90 lvlError = 0,
91 lvlInfo, 91 lvlInfo,
92 lvlTalkative, 92 lvlTalkative,
93 lvlChatty, 93 lvlChatty,
94 lvlDebug, 94 lvlDebug,
95 lvlVomit 95 lvlVomit
96} Verbosity; 96};
97 97
98 98
99} 99}
diff --git a/nix/libutil/util.hh b/nix/libutil/util.hh
index 03234e3a5d2..176247e699d 100644
--- a/nix/libutil/util.hh
+++ b/nix/libutil/util.hh
@@ -121,15 +121,6 @@ Paths createDirs(const Path & path);
121void createSymlink(const Path & target, const Path & link); 121void createSymlink(const Path & target, const Path & link);
122 122
123 123
124template<class T, class A>
125T singleton(const A & a)
126{
127 T t;
128 t.insert(a);
129 return t;
130}
131
132
133/* Messages. */ 124/* Messages. */
134 125
135 126