diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-08-02 23:37:51 -0300 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-08-23 03:06:53 +0000 |
| commit | 8d59f43f445164e8cc8bd3fe1a23bd04e807a6b3 (patch) | |
| tree | 6a673397f921070d8a86d026380548d5e251a29f /lib/concepts/Object.ml | |
| parent | b762cb41da4d822416c3ab66940622882745fc0a (diff) | |
| download | RNT-8d59f43f445164e8cc8bd3fe1a23bd04e807a6b3.tar.gz RNT-8d59f43f445164e8cc8bd3fe1a23bd04e807a6b3.zip | |
format
Diffstat (limited to 'lib/concepts/Object.ml')
| -rw-r--r-- | lib/concepts/Object.ml | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/concepts/Object.ml b/lib/concepts/Object.ml index 22fb14a..aacbda6 100644 --- a/lib/concepts/Object.ml +++ b/lib/concepts/Object.ml @@ -6,13 +6,10 @@ module type S = sig type t val equal : t -> t -> bool - val to_bencode : t -> bencode val of_bencode : bencode -> (t, Condition.condition) result - val to_blob : t -> Representation.blob val of_blob : Representation.blob -> (t, Condition.condition) result - val to_bytes : t -> bytes val of_bytes : bytes -> (t, Condition.condition) result end @@ -51,13 +48,11 @@ module Codec = struct let to_bencode object_ = Bencode.Tagged (B.tag, Bencode.Dict (B.fields object_)) let of_bencode = function - | Bencode.Tagged (tag, (Bencode.Dict _ as data)) when Char.equal tag B.tag -> - B.of_fields data + | Bencode.Tagged (tag, (Bencode.Dict _ as data)) when Char.equal tag B.tag -> B.of_fields data | _ -> Error (B.malformed ()) let to_blob object_ = to_bencode object_ |> Bencode.to_blob let of_blob blob = Bencode.of_blob blob |> Utilities.Result.fmap of_bencode - let to_bytes object_ = to_blob object_ |> Representation.bytes_of_blob let of_bytes bytes = Bencode.of_bytes bytes |> Utilities.Result.fmap of_bencode end |
