From 5eab370225059d99803beb979a98d884faf7a857 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Thu, 29 May 2025 15:20:42 +0200 Subject: [PATCH] Replace `list_to_seq` by `List.to_seq` Since it exists since OCaml 4.07+ and our minimum version is 4.08 now there is no need to ship our own implementation. --- test/test_write.ml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/test/test_write.ml b/test/test_write.ml index cffc7d27..1844f1a8 100644 --- a/test/test_write.ml +++ b/test/test_write.ml @@ -42,16 +42,11 @@ let to_file_tests = fun () -> test ~suf:"" Fixtures.json_string ); ] -(* List.to_seq is not available on old OCaml versions. *) -let rec list_to_seq = function - | [] -> fun () -> Seq.Nil - | x :: xs -> fun () -> Seq.Cons (x, list_to_seq xs) - let seq_to_file_tests = let test ?suf () = let output_file = Filename.temp_file "test_yojson_seq_to_file" ".json" in let data = [ `String "foo"; `String "bar" ] in - Yojson.Safe.seq_to_file ?suf output_file (list_to_seq data); + Yojson.Safe.seq_to_file ?suf output_file (List.to_seq data); let read_data = let seq = Yojson.Safe.seq_from_file output_file in let acc = ref [] in