From 4c2a9f1602e2de46e6a6c16c6bfe6bf5cfd3f359 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 20 May 2024 16:19:22 -0400 Subject: [PATCH] =?UTF-8?q?reformat=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- benchs/pi.ml | 6 +++--- src/lwt/IO_in.ml | 13 ++++++------- src/lwt/IO_out.ml | 13 ++++++------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/benchs/pi.ml b/benchs/pi.ml index 63ddc2ca..e9d333f5 100644 --- a/benchs/pi.ml +++ b/benchs/pi.ml @@ -149,7 +149,7 @@ let () = Printf.printf "pi=%.6f (pi=%.6f, diff=%.3f)%s\n%!" res Float.pi (abs_float (Float.pi -. res)) (if !time then - spf " in %.4fs" elapsed - else - ""); + spf " in %.4fs" elapsed + else + ""); () diff --git a/src/lwt/IO_in.ml b/src/lwt/IO_in.ml index a0e2744a..0a7e33bc 100644 --- a/src/lwt/IO_in.ml +++ b/src/lwt/IO_in.ml @@ -1,14 +1,13 @@ open Common_ -class type t = - object - method input : bytes -> int -> int -> int - (** Read into the slice. Returns [0] only if the +class type t = object + method input : bytes -> int -> int -> int + (** Read into the slice. Returns [0] only if the stream is closed. *) - method close : unit -> unit - (** Close the input. Must be idempotent. *) - end + method close : unit -> unit + (** Close the input. Must be idempotent. *) +end let create ?(close = ignore) ~input () : t = object diff --git a/src/lwt/IO_out.ml b/src/lwt/IO_out.ml index 9c1207dc..522d3e0a 100644 --- a/src/lwt/IO_out.ml +++ b/src/lwt/IO_out.ml @@ -1,12 +1,11 @@ open Common_ -class type t = - object - method output_char : char -> unit - method output : bytes -> int -> int -> unit - method flush : unit -> unit - method close : unit -> unit - end +class type t = object + method output_char : char -> unit + method output : bytes -> int -> int -> unit + method flush : unit -> unit + method close : unit -> unit +end let create ?(flush = ignore) ?(close = ignore) ~output_char ~output () : t = object