We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6516522 commit 5cafdf3Copy full SHA for 5cafdf3
src/odoc/occurrences.ml
@@ -1,7 +1,18 @@
1
open Or_error
2
3
+(* Copied from ocaml 5.0 String module *)
4
+let string_starts_with ~prefix s =
5
+ let open String in
6
+ let len_s = length s and len_pre = length prefix in
7
+ let rec aux i =
8
+ if i = len_pre then true
9
+ else if unsafe_get s i <> unsafe_get prefix i then false
10
+ else aux (i + 1)
11
+ in
12
+ len_s >= len_pre && aux 0
13
+
14
let handle_file file ~f =
- if String.starts_with ~prefix:"src-" (Fpath.filename file) then
15
+ if string_starts_with ~prefix:"src-" (Fpath.filename file) then
16
Odoc_file.load file |> function
17
| Error _ as e -> e
18
| Ok unit' -> (
0 commit comments