Skip to content

Commit

Permalink
Eio: use functions instead of direct methods
Browse files Browse the repository at this point in the history
  • Loading branch information
SGrondin committed Jun 23, 2023
1 parent 137d5ba commit 0b6fc00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion benchmarks/eio_benchmark.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let main env =
| "json" -> Angstrom.(RFC7159.json >>| fun x -> `Json x)
| _ -> print_endline "usage: eio_json_benchmark.native PARSER"; exit 1
in
Angstrom_eio.parse_many parser toss env#stdin
Angstrom_eio.parse_many parser toss (Eio.Stdenv.stdin env)
|> function
| _, Ok () -> ()
| _, Error err -> failwith err
Expand Down
4 changes: 2 additions & 2 deletions eio/angstrom_eio.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let parse ?(pushback = default_pushback) parser src =
| (Fail _ as state) ->
handle_parse_result state
| Partial feed as state -> (
match src#read_into buf with
match Eio.Flow.single_read src buf with
| 0
| (exception End_of_file) ->
finalize state |> handle_parse_result
Expand All @@ -68,7 +68,7 @@ let rec buffered_state_loop pushback state src (buf : Cstruct.t) =
match state with
| Partial k ->
let next =
match src#read_into buf with
match Eio.Flow.single_read src buf with
| 0
| (exception End_of_file) ->
k `Eof
Expand Down

0 comments on commit 0b6fc00

Please sign in to comment.