Skip to content

Commit

Permalink
Fix ocamlformat config and formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Sven Anderson <[email protected]>
  • Loading branch information
ansiwen committed Jul 31, 2022
1 parent faa13c5 commit 59b3279
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
profile = sparse
profile = default
break-cases = nested
break-fun-decl = smart
cases-exp-indent = 2
Expand Down
9 changes: 1 addition & 8 deletions mirage/gluten_mirage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,18 @@ open Lwt.Infix
module Make_IO (Flow : Mirage_flow.S) :
Gluten_lwt.IO with type socket = Flow.flow and type addr = unit = struct
type socket = Flow.flow

type addr = unit

let shutdown flow = Flow.close flow

let shutdown_receive flow = Lwt.async (fun () -> shutdown flow)

let close = shutdown

let read flow bigstring ~off ~len:_ =
Lwt.catch
(fun () ->
Flow.read flow >|= function
| Ok (`Data buf) ->
Bigstringaf.blit
buf.buffer
~src_off:buf.off
bigstring
~dst_off:off
Bigstringaf.blit buf.buffer ~src_off:buf.off bigstring ~dst_off:off
~len:buf.len;
`Ok buf.len
| Ok `Eof ->
Expand Down

0 comments on commit 59b3279

Please sign in to comment.