about summary refs log tree commit diff
path: root/third_party/nix/src/nix-env/nix-env.cc
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-08-21T02·23+0100
committertazjin <mail@tazj.in>2020-08-21T03·55+0000
commit7edbe59c6c70cd085fc68c4317c3a71a40ac21e5 (patch)
treeb036747e1c9615c2abbd58560353e704d51bc922 /third_party/nix/src/nix-env/nix-env.cc
parent674d921202754661bfcc02ef8fe40ade227349cb (diff)
style(tvix): Replace remaining typedefs with using statements r/1702
Change (mostly) created via:

  fd . -e hh -e cc | parallel clang-tidy -p ~/builds/nix --fix "'--checks=-*,modernize-use-using'"

Change-Id: I90ad6e64a5399f2005dfb9956074ec51c2c78cea
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1830
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
Diffstat (limited to 'third_party/nix/src/nix-env/nix-env.cc')
-rw-r--r--third_party/nix/src/nix-env/nix-env.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/third_party/nix/src/nix-env/nix-env.cc b/third_party/nix/src/nix-env/nix-env.cc
index 9c0931e7f4ad..830bd514dafb 100644
--- a/third_party/nix/src/nix-env/nix-env.cc
+++ b/third_party/nix/src/nix-env/nix-env.cc
@@ -32,14 +32,14 @@
 using namespace nix;
 using std::cout;
 
-typedef enum {
+using InstallSourceType = enum {
   srcNixExprDrvs,
   srcNixExprs,
   srcStorePaths,
   srcProfile,
   srcAttrPath,
   srcUnknown
-} InstallSourceType;
+};
 
 struct InstallSourceInfo {
   InstallSourceType type;
@@ -229,7 +229,7 @@ static DrvInfos filterBySelector(EvalState& state, const DrvInfos& allElems,
   std::set<unsigned int> done;
 
   for (auto& i : selectors) {
-    typedef std::list<std::pair<DrvInfo, unsigned int> > Matches;
+    using Matches = std::list<std::pair<DrvInfo, unsigned int> >;
     Matches matches;
     unsigned int n = 0;
     for (auto j = allElems.begin(); j != allElems.end(); ++j, ++n) {
@@ -249,7 +249,7 @@ static DrvInfos filterBySelector(EvalState& state, const DrvInfos& allElems,
        arbitrarily pick the first one. */
     if (newestOnly) {
       /* Map from package names to derivations. */
-      typedef std::map<std::string, std::pair<DrvInfo, unsigned int> > Newest;
+      using Newest = std::map<std::string, std::pair<DrvInfo, unsigned int> >;
       Newest newest;
       StringSet multiple;
 
@@ -834,7 +834,7 @@ void printTable(Table& table) {
    least one element with a higher version in the set.  `cvUnavail'
    means that there are no elements with the same name in the set. */
 
-typedef enum { cvLess, cvEqual, cvGreater, cvUnavail } VersionDiff;
+using VersionDiff = enum { cvLess, cvEqual, cvGreater, cvUnavail };
 
 static VersionDiff compareVersionAgainstSet(const DrvInfo& elem,
                                             const DrvInfos& elems,