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.

wal, block, sse, zephyr: remove [mutable] from never-reassigned fields

Warning 69 (unused-field, mutable-never-assigned). Four independent
record fields were flagged as mutable but the code only mutates their
referents in place, never rebinds the record slot itself:

- ocaml-wal/lib/wal.ml: [t.file] (the Eio file resource; methods call
Eio.File.pwrite_all etc., the slot is set once at open time).
- ocaml-block/lib/block.ml: [Memory.state.data] (the backing bytes,
written via Bytes.blit_string; [Bytes.t] is already mutable).
- ocaml-sse/lib/sse.ml: [Parser.t.data_buf] (a Buffer.t, written via
Buffer.add_*; the slot never changes).
- ocaml-zephyr/lib/zephyr.ml: drop [mode : Read | Write] entirely —
set at open-time, read nowhere. The open_read / open_write
constructors already distinguish the two call shapes, so mode
tracking was redundant.

+21 -9
+3
dune
··· 1 + (env 2 + (dev 3 + (flags :standard %{dune-warnings})))
+1 -1
lib/yaml/dune
··· 1 1 (library 2 2 (name irmin_yaml) 3 3 (public_name irmin.yaml) 4 - (libraries irmin yamlrw digestif)) 4 + (libraries irmin yaml digestif))
+17 -8
lib/yaml/irmin_yaml.ml
··· 3 3 module S = Irmin.SHA256 4 4 5 5 (* Round-trip a YAML scalar through string form. *) 6 - let enc v = Yamlrw.to_string v 7 - let dec s = try Yamlrw.of_string s with _ -> `Null 6 + let enc v = Yaml.encode_string Yaml.Codec.value v 7 + 8 + let dec s = 9 + match Yaml.decode_string Yaml.Codec.value s with 10 + | Ok v -> v 11 + | Error _ -> Yaml.Null 8 12 9 13 let parse : S.dec = 10 14 fun block -> 11 15 match dec block with 12 - | `O pairs -> S.Named (List.map (fun (k, v) -> (k, `Inline (enc v))) pairs) 13 - | `A items -> 16 + | Yaml.Mapping pairs -> 17 + S.Named (List.map (fun (k, v) -> (k, `Inline (enc v))) pairs) 18 + | Yaml.Sequence items -> 14 19 S.Indexed 15 20 (Array.of_list (List.map (fun v -> (`Inline (enc v) : S.child)) items)) 16 21 | _ -> S.Named [] ··· 21 26 List.map 22 27 (fun (name, child) -> 23 28 let v = 24 - match child with `Inline data -> dec data | `Link _ -> `Null 29 + match child with 30 + | `Inline data -> dec data 31 + | `Link _ -> Yaml.Null 25 32 in 26 33 (name, v)) 27 34 children 28 35 in 29 - enc (`O pairs) 36 + enc (Yaml.Mapping pairs) 30 37 | S.Indexed children -> 31 38 let items = 32 39 Array.to_list 33 40 (Array.map 34 41 (fun child -> 35 - match child with `Inline data -> dec data | `Link _ -> `Null) 42 + match child with 43 + | `Inline data -> dec data 44 + | `Link _ -> Yaml.Null) 36 45 children) 37 46 in 38 - enc (`A items) 47 + enc (Yaml.Sequence items) 39 48 40 49 let ( => ) = S.( => ) 41 50