From 876bc8fb26300eeed06a36b646de575a7241cb44 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 25 Jun 2024 03:19:57 +0100 Subject: [PATCH] refactor(curl): remove pointless string passing Signed-off-by: Rudi Grinberg --- cohttp-curl-async/src/cohttp_curl_async.ml | 10 +++++----- cohttp-curl-lwt/src/cohttp_curl_lwt.ml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cohttp-curl-async/src/cohttp_curl_async.ml b/cohttp-curl-async/src/cohttp_curl_async.ml index e94e2893de..f3587e90e9 100644 --- a/cohttp-curl-async/src/cohttp_curl_async.ml +++ b/cohttp-curl-async/src/cohttp_curl_async.ml @@ -32,7 +32,7 @@ module Context = struct timeout = None; } in - let rec finished s = + let rec finished () = match Curl.Multi.remove_finished t.mt with | None -> () | Some (h, code) -> @@ -41,19 +41,19 @@ module Context = struct | Some w -> Hashtbl.remove t.wakeners h; Ivar.fill_exn w code); - finished s + finished () in let on_readable fd = let (_ : int) = Curl.Multi.action t.mt (Fd.file_descr_exn fd) EV_IN in - finished "on_readable" + finished () in let on_writable fd = let (_ : int) = Curl.Multi.action t.mt (Fd.file_descr_exn fd) EV_OUT in - finished "on_writable" + finished () in let on_timer () = Curl.Multi.action_timeout t.mt; - finished "on_timer" + finished () in Curl.Multi.set_timer_function t.mt (fun timeout -> (match t.timeout with diff --git a/cohttp-curl-lwt/src/cohttp_curl_lwt.ml b/cohttp-curl-lwt/src/cohttp_curl_lwt.ml index 696540c311..729d2d1ad7 100644 --- a/cohttp-curl-lwt/src/cohttp_curl_lwt.ml +++ b/cohttp-curl-lwt/src/cohttp_curl_lwt.ml @@ -44,7 +44,7 @@ module Context = struct timer_event = Lwt_engine.fake_event; } in - let rec finished s = + let rec finished () = match Curl.Multi.remove_finished t.mt with | None -> () | Some (h, code) -> @@ -53,20 +53,20 @@ module Context = struct | Some w -> Hashtbl.remove t.wakeners h; Lwt.wakeup w code); - finished s + finished () in let on_readable fd _ = let (_ : int) = Curl.Multi.action t.mt fd EV_IN in - finished "on_readable" + finished () in let on_writable fd _ = let (_ : int) = Curl.Multi.action t.mt fd EV_OUT in - finished "on_writable" + finished () in let on_timer _ = Lwt_engine.stop_event t.timer_event; Curl.Multi.action_timeout t.mt; - finished "on_timer" + finished () in Curl.Multi.set_timer_function t.mt (fun timeout -> Lwt_engine.stop_event t.timer_event;