From 4d23231ee05ace175f0694114572e298150a467d Mon Sep 17 00:00:00 2001 From: ยท๐‘‘๐‘ด๐‘•๐‘‘๐‘ฉ๐‘ค Date: Wed, 10 Dec 2025 20:51:40 +0000 Subject: manifest: do hash algo --- lib/manifest.ml | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3