Persistent store with Git semantics: lazy reads, delayed writes, content-addressing
1
fork

Configure Feed

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

irmin: migrate json/oci backends to new Json.Value API

Use the infallible Json.Value.to_string and Json.Value.of_string for
generic AST serialisation instead of the codec form Json.to_string
Json.t / Json.of_string Json.t which no longer exists (Json.t is a
type, not a value, in the new API).

+6 -10
+3 -5
lib/json/irmin_json.ml
··· 8 8 module S = Irmin.SHA256 9 9 10 10 let nv (type a) (n : a Json.node) : a = fst n 11 - 12 - let enc c = 13 - match Json.to_string Json.Codec.Value.t c with Ok s -> s | Error _ -> "" 11 + let enc c = Json.Value.to_string c 14 12 15 13 let parse : S.dec = 16 14 fun block -> 17 - match Json.of_string Json.Codec.Value.t block with 15 + match Json.Value.of_string block with 18 16 | Ok (Json.Object obj) -> 19 17 S.Named 20 18 (List.map (fun ((n, c) : Json.mem) -> (nv n, `Inline (enc c))) (nv obj)) ··· 25 23 | _ -> S.Named [] 26 24 27 25 let dec s = 28 - match Json.of_string Json.Codec.Value.t s with 26 + match Json.Value.of_string s with 29 27 | Ok v -> v 30 28 | Error _ -> Json.Null ((), Json.Meta.none) 31 29
+3 -5
lib/oci/irmin_oci.ml
··· 9 9 (* OCI manifests and configs are JSON. Reuse the JSON codec pattern. *) 10 10 11 11 let nv (type a) (n : a Json.node) : a = fst n 12 - 13 - let enc c = 14 - match Json.to_string Json.Codec.Value.t c with Ok s -> s | Error _ -> "" 12 + let enc c = Json.Value.to_string c 15 13 16 14 let dec s = 17 - match Json.of_string Json.Codec.Value.t s with 15 + match Json.Value.of_string s with 18 16 | Ok v -> v 19 17 | Error _ -> Json.Null ((), Json.Meta.none) 20 18 21 19 let parse : S.dec = 22 20 fun block -> 23 - match Json.of_string Json.Codec.Value.t block with 21 + match Json.Value.of_string block with 24 22 | Ok (Json.Object obj) -> 25 23 S.Named 26 24 (List.map (fun ((n, c) : Json.mem) -> (nv n, `Inline (enc c))) (nv obj))