diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-08-02 23:38:05 -0300 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-08-23 03:06:53 +0000 |
| commit | b790c77c5e42a220a8419c69dbea3e392ee60fbe (patch) | |
| tree | 546d27d92f470d7f90ea7a76b6720039f3ed4291 /lib/concepts/Branch.ml | |
| parent | 8d59f43f445164e8cc8bd3fe1a23bd04e807a6b3 (diff) | |
| download | RNT-b790c77c5e42a220a8419c69dbea3e392ee60fbe.tar.gz RNT-b790c77c5e42a220a8419c69dbea3e392ee60fbe.zip | |
Revert "format"
This reverts commit fee14f4b29840357f87f02d51953f41ce90f7d9e.
Diffstat (limited to '')
| -rw-r--r-- | lib/concepts/Branch.ml | 13 | ||||
| -rw-r--r-- | lib/concepts/Branch.mli | 1 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/concepts/Branch.ml b/lib/concepts/Branch.ml index 57c46b3..cd4213b 100644 --- a/lib/concepts/Branch.ml +++ b/lib/concepts/Branch.ml @@ -1,5 +1,8 @@ type address = Hash.hash -type t = {name: string; target: address} + +type t = + { name: string; + target: address } module Field = struct let name = "name" @@ -19,6 +22,7 @@ module Error = struct end let make ~name ~target = {name; target} + let name branch = branch.name let target branch = branch.target @@ -27,10 +31,13 @@ module Body = struct let tag = 'b' let malformed = Error.malformed_branch - let equal left right = left.name = right.name && Hash.hash_equals left.target right.target + + let equal left right = + left.name = right.name && Hash.hash_equals left.target right.target let fields branch = - [Field.name, Object.Field.string branch.name; Field.target, Object.Field.address branch.target] + [ Field.name, Object.Field.string branch.name; + Field.target, Object.Field.address branch.target ] let of_fields data = let open Utilities.Result in diff --git a/lib/concepts/Branch.mli b/lib/concepts/Branch.mli index 3fb6ebe..0e7e9f9 100644 --- a/lib/concepts/Branch.mli +++ b/lib/concepts/Branch.mli @@ -4,5 +4,6 @@ type address = Hash.hash include Object.S with type t := t val make : name:string -> target:address -> t + val name : t -> string val target : t -> address |
