aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/Branch.ml
diff options
context:
space:
mode:
authorEstevan Castilho <tevo@riajuu.net>2026-10-24 01:49:53 +0000
committerEstevan Castilho <tevo@riajuu.net>2026-10-24 01:49:53 +0000
commit5a6af8a74895b548ed39649aef4a09fb53b4dbbc (patch)
tree76b0e3b15e73bb8c51d95cda41b50843e7229151 /lib/kernel/Branch.ml
parent0f5161930584eaf91fd195b891ce7d9130c7b7f1 (diff)
downloadRNT-5a6af8a74895b548ed39649aef4a09fb53b4dbbc.tar.gz
RNT-5a6af8a74895b548ed39649aef4a09fb53b4dbbc.zip
Avoid implementing `Directory` inline?
Diffstat (limited to '')
-rw-r--r--lib/kernel/Branch.ml19
1 files changed, 4 insertions, 15 deletions
diff --git a/lib/kernel/Branch.ml b/lib/kernel/Branch.ml
index 439339e..89a16ff 100644
--- a/lib/kernel/Branch.ml
+++ b/lib/kernel/Branch.ml
@@ -143,21 +143,10 @@ module Make (S : Abstract.Storage.STORAGE) = struct
update_only (fun node' ->
Handle.require Addressable.from node'
|> Result.map Addressable.address
- |>> (fun addr -> self#deriving {branch with multigroups= addr}) ) ) ] );
- Directory.make
- object
- method list =
- Ok
- (BatFingerTree.of_list
- ( "multigroup"
- :: Option.fold ~none:[] ~some:(fun _ -> ["previous"]) branch.previous ) )
-
- method find =
- function
- | "multigroup" -> Ok (Some multigroups)
- | "previous" -> self#previous
- | _ -> Ok None
- end ]
+ |>> fun addr -> self#deriving {branch with multigroups= addr} ) ) ] );
+ Prototype.Directory.of_properties'
+ [ ("multigroup", fun () -> Ok (Some multigroups));
+ ("previous", fun () -> self#previous) ] ]
method hash = Representation.to_blob branch |> Concepts.Hash.hash_of_blob
method address = self#hash