From 47d59988c2119221a872bf79f46230f1c7a659a3 Mon Sep 17 00:00:00 2001 From: Matthieu Dubuget Date: Sun, 22 Nov 2026 19:20:04 +0100 Subject: [PATCH] gen_licenses: simplify the removal of the trailing CR with String.trim --- tools/gen_licenses.ml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/gen_licenses.ml b/tools/gen_licenses.ml index 976ae5e..308c8a0 100644 --- a/tools/gen_licenses.ml +++ b/tools/gen_licenses.ml @@ -21,13 +21,9 @@ let rec map_result f = function Ok (y :: ys) let ocamlfind args = Cmd.(v "ocamlfind" %% of_list args) -let chop_cr s = - let n = String.length s in - if n > 0 && s.[n - 1] = '\r' then String.sub s 0 (n - 1) else s - let lines cmd = let* l = OS.Cmd.(run_out cmd |> to_lines) in - Ok (List.map chop_cr l) + Ok (List.map String.trim l) let line cmd = let* l = lines cmd in