revive get_partial and size (needed by mirage-kv 5)

This commit is contained in:
Hannes Mehnert 2022-09-27 17:09:48 +02:00
parent 6c58b74f6a
commit 8e8f002d5e

View file

@ -429,7 +429,7 @@ let get t key =
| Blob b -> Ok (Git.Blob.to_string b) | Blob b -> Ok (Git.Blob.to_string b)
| _ -> Error (`Value_expected key) | _ -> Error (`Value_expected key)
let _get_partial t key ~offset ~length = let get_partial t key ~offset ~length =
let open Lwt_result.Infix in let open Lwt_result.Infix in
get t key >|= fun data -> get t key >|= fun data ->
if String.length data < offset then if String.length data < offset then
@ -486,7 +486,7 @@ let digest t key =
~some:(fun x -> Ok (Store.Hash.to_hex x)) ~some:(fun x -> Ok (Store.Hash.to_hex x))
t.head |> Lwt.return t.head |> Lwt.return
let _size t key = let size t key =
let open Lwt_result.Infix in let open Lwt_result.Infix in
get t key >|= fun data -> get t key >|= fun data ->
String.length data String.length data