summaryrefslogtreecommitdiff
path: root/lib/manifest.ml
diff options
context:
space:
mode:
authorยท๐‘‘๐‘ด๐‘•๐‘‘๐‘ฉ๐‘ค2025-12-10 20:51:40 +0000
committerยท๐‘‘๐‘ด๐‘•๐‘‘๐‘ฉ๐‘ค2025-12-10 20:51:40 +0000
commit4d23231ee05ace175f0694114572e298150a467d (patch)
tree20f32e776ba2b0fe5abd623b8873aff27016b582 /lib/manifest.ml
parent2b69aa9def94d45b641d266bf9b3549e384bd7a1 (diff)
downloadnixtaml-4d23231ee05ace175f0694114572e298150a467d.tar
nixtaml-4d23231ee05ace175f0694114572e298150a467d.tar.gz
nixtaml-4d23231ee05ace175f0694114572e298150a467d.tar.bz2
nixtaml-4d23231ee05ace175f0694114572e298150a467d.tar.lz
nixtaml-4d23231ee05ace175f0694114572e298150a467d.tar.xz
nixtaml-4d23231ee05ace175f0694114572e298150a467d.tar.zst
nixtaml-4d23231ee05ace175f0694114572e298150a467d.zip
manifest: do hash algo
Diffstat (limited to 'lib/manifest.ml')
-rw-r--r--lib/manifest.ml28
1 files changed, 11 insertions, 17 deletions
diff --git a/lib/manifest.ml b/lib/manifest.ml
index 725cbc5..8cadce5 100644
--- a/lib/manifest.ml
+++ b/lib/manifest.ml
@@ -371,23 +371,17 @@ module Hash = struct
let codec : t Util.KDL.codec = {
to_kdl = (fun hash ->
let open Kdl in
- if hash.algorithm != Input.Hash.default_algorithm || Option.is_some hash.expected then
- let props =
- match hash.expected with
- | None -> []
- | Some exp_hash ->
- ["expected", (None, `String exp_hash)]
- in
- let props =
- if hash.algorithm != Input.Hash.default_algorithm then
- let algo_str = Input.Hash.algorithm_to_string hash.algorithm in
- ("algorithm", (None, `String algo_str)) :: props
- else
- props
- in
- [node "hash" ~props []]
- else
- []
+ let props =
+ match hash.expected with
+ | None -> []
+ | Some exp_hash ->
+ ["expected", (None, `String exp_hash)]
+ in
+ let props =
+ let algo_str = Input.Hash.algorithm_to_string hash.algorithm in
+ ("algorithm", (None, `String algo_str)) :: props
+ in
+ [node "hash" ~props []]
);
of_kdl = (fun kdl ->
let open Util.KDL.L in