Skip to content

Commit

Permalink
Fix compilation on 4.08
Browse files Browse the repository at this point in the history
  • Loading branch information
andersfugmann committed Apr 13, 2024
1 parent bc5acf3 commit 40f05d0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/plugin/utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module String = struct
include String

let trim_end ~chars s =
let chars = String.to_seq chars |> List.of_seq in
let len = String.length s in
let chars = to_seq chars |> List.of_seq in
let len = length s in
let rcount s =
let rec inner = function
| 0 -> len
Expand All @@ -20,7 +20,7 @@ module String = struct
in
match rcount s with
| 0 -> s
| n -> String.sub ~pos:0 ~len:(String.length s - n) s
| n -> sub ~pos:0 ~len:(length s - n) s

let starts_with_regex ~regex str =
let regex = Str.regexp ("^" ^ regex) in
Expand All @@ -44,9 +44,9 @@ module List = struct

let group ~f lines =
let prepend acc group last =
let acc = match List.is_empty group with
let acc = match is_empty group with
| true -> acc
| false -> (last, List.rev group) :: acc
| false -> (last, rev group) :: acc
in
acc
in
Expand All @@ -55,7 +55,7 @@ module List = struct
inner acc (x :: group) last xs
| x :: xs ->
inner (prepend acc group last) [x] (not last) xs
| [] -> List.rev (prepend acc group last)
| [] -> rev (prepend acc group last)
in
inner [] [] false lines

Expand Down

0 comments on commit 40f05d0

Please sign in to comment.