Skip to content

Commit

Permalink
remove use of 5.1 only function
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Mar 21, 2024
1 parent 8e63408 commit ba1876f
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions test/lwt/hash_client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@ let main ~port ~runner ~ext ~dir ~n_conn () : unit Lwt.t =
()
else if Str_tbl.mem seen file then
()
else if Sys.is_regular_file file then
if ext <> "" && Filename.extension file <> ext then
()
else (
Str_tbl.add seen file ();
M_lwt.run_in_lwt_and_await (fun () -> Lwt_io.write_line oc file);
let res =
M_lwt.run_in_lwt_and_await (fun () -> Lwt_io.read_line ic)
in
let@ () = M.Lock.with_ lock_stdout in
Printf.printf "%s\n%!" res
)
else if Sys.is_directory file then (
let _sp =
Trace.enter_manual_sub_span ~parent:_sp ~__FILE__ ~__LINE__ "walk-dir"
Expand All @@ -53,6 +41,14 @@ let main ~port ~runner ~ext ~dir ~n_conn () : unit Lwt.t =
let d = Sys.readdir file in
Array.sort String.compare d;
Array.iter (fun sub -> walk (Filename.concat file sub)) d
) else if ext <> "" && Filename.extension file <> ext then
()
else (
Str_tbl.add seen file ();
M_lwt.run_in_lwt_and_await (fun () -> Lwt_io.write_line oc file);
let res = M_lwt.run_in_lwt_and_await (fun () -> Lwt_io.read_line ic) in
let@ () = M.Lock.with_ lock_stdout in
Printf.printf "%s\n%!" res
)
in
walk dir;
Expand Down

0 comments on commit ba1876f

Please sign in to comment.