diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-07-13 03:02:09 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-07-13 03:02:09 +0000 |
commit | c466cb2091b7a382aba1739c0320f2b6c0a04c1e (patch) | |
tree | 0532aad8e8753b046b1309ef6f8f646bc279ef03 /src/libstore/content-address.cc | |
parent | 323d51a7a05d81c717d8e8673a78b07500a591fe (diff) | |
parent | 44157653850ce18536f837d7ed53521d61a238a1 (diff) |
Merge branch 'hash-always-has-type' into better-ca-parse-errors
Diffstat (limited to 'src/libstore/content-address.cc')
-rw-r--r-- | src/libstore/content-address.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstore/content-address.cc b/src/libstore/content-address.cc index 470cc62c9..a562f2d23 100644 --- a/src/libstore/content-address.cc +++ b/src/libstore/content-address.cc @@ -92,4 +92,16 @@ std::string renderContentAddress(std::optional<ContentAddress> ca) { return ca ? renderContentAddress(*ca) : ""; } +Hash getContentAddressHash(const ContentAddress & ca) +{ + return std::visit(overloaded { + [](TextHash th) { + return th.hash; + }, + [](FixedOutputHash fsh) { + return fsh.hash; + } + }, ca); +} + } |