diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-19 17:42:56 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-19 17:42:56 +0000 |
commit | 911fc88bcb467ff779c5d0ab49e0a5525f284e19 (patch) | |
tree | c639f8f2398476ef66318d935de46547f2cd4904 /src/libstore/content-address.cc | |
parent | 2f0e395c99f926b9f0a65e37ea644a40ec5dddfa (diff) |
More designated initializers
Diffstat (limited to 'src/libstore/content-address.cc')
-rw-r--r-- | src/libstore/content-address.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libstore/content-address.cc b/src/libstore/content-address.cc index 98b3677bb..3d753836f 100644 --- a/src/libstore/content-address.cc +++ b/src/libstore/content-address.cc @@ -55,10 +55,16 @@ ContentAddress parseContentAddress(std::string_view rawCa) { auto methodAndHash = rawCa.substr(prefixSeparator+1, string::npos); if (methodAndHash.substr(0,2) == "r:") { std::string_view hashRaw = methodAndHash.substr(2,string::npos); - return FixedOutputHash { FileIngestionMethod::Recursive, Hash(string(hashRaw)) }; + return FixedOutputHash { + .method = FileIngestionMethod::Recursive, + .hash = Hash(string(hashRaw)), + }; } else { std::string_view hashRaw = methodAndHash; - return FixedOutputHash { FileIngestionMethod::Flat, Hash(string(hashRaw)) }; + return FixedOutputHash { + .method = FileIngestionMethod::Flat, + .hash = Hash(string(hashRaw)), + }; } } else { throw Error("parseContentAddress: format not recognized; has to be text or fixed"); |