File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -183,13 +183,12 @@ let run_toplevel_tests ?root c ppf tests t =
183183 Block. pp_footer ppf ()
184184
185185let trim l =
186- let rec aux = function
187- | [] -> []
188- | h :: t -> if String. trim h = " " then aux t else String. trim h :: t
186+ let rec trim_front = function
187+ | "" :: t -> trim_front t
188+ | l -> l
189189 in
190- let no_head = aux l in
191- let no_tail = List. rev (aux (List. rev no_head)) in
192- no_tail
190+ let rev_trim l = trim_front (List. rev (trim_front l)) in
191+ rev_trim (List. rev_map String. trim l)
193192
194193type file = { first : Mdx_top.Part .file ; current : Mdx_top.Part .file }
195194
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ let () =
3737 ()
3838;;
3939
40-
4140let x = 34
4241let f = 42.3
4342let s = "toto"
@@ -48,7 +47,6 @@ let () =
4847 print_float f
4948;;
5049
51-
5250let () =
5351 print_string s
5452;;
You can’t perform that action at this time.
0 commit comments