OCaml library and CLI for OCI and Docker image manipulation
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

codec: small lib let open Json.Codec in cleanup

gdocs/{comments,store}, meross/abilities, oci/spec/arch. The
gdocs/comments record had a stray-edit casualty -- a `t_continued`
fragment from an interrupted edit -- collapsed back into a single
clean record. Hoisted `let id (t : t) = t.id` accessor for comments;
others are clash-free.

+6 -4
+6 -4
lib/spec/arch.ml
··· 53 53 | s -> error_msg "Arch.of_string: invalid string (%S)" s 54 54 55 55 let jsont = 56 - Json.Codec.map ~kind:"arch" 56 + let open Json.Codec in 57 + map ~kind:"arch" 57 58 ~dec:(fun s -> match of_string s with Ok v -> v | Error _ -> Unknown) 58 - ~enc:to_string Json.Codec.string 59 + ~enc:to_string string 59 60 60 61 let pp = Fmt.of_to_string to_string 61 62 ··· 75 76 | s -> error_msg "Arch.variant_of_string: invalid string (%S)" s 76 77 77 78 let variant_jsont = 78 - Json.Codec.map ~kind:"arch.variant" 79 + let open Json.Codec in 80 + map ~kind:"arch.variant" 79 81 ~dec:(fun s -> match variant_of_string s with Ok v -> v | Error _ -> V8) 80 - ~enc:variant_to_string Json.Codec.string 82 + ~enc:variant_to_string string 81 83 82 84 let pp_variant = Fmt.of_to_string variant_to_string