Skip to content

Commit 20c1a69

Browse files
committed
Compat
1 parent 112ae53 commit 20c1a69

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/html/link.ml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@ module Path = struct
1515

1616
let remap config f =
1717
let l = String.concat "/" f in
18-
match
19-
List.find_opt
20-
(fun (prefix, _replacement) -> Astring.String.is_prefix ~affix:prefix l)
21-
(Config.remap config)
22-
with
23-
| None -> None
24-
| Some (prefix, replacement) ->
25-
let len = String.length prefix in
26-
let l = String.sub l len (String.length l - len) in
27-
Some (replacement ^ l)
18+
try
19+
let prefix, replacement =
20+
List.find
21+
(fun (prefix, _replacement) ->
22+
Astring.String.is_prefix ~affix:prefix l)
23+
(Config.remap config)
24+
in
25+
let len = String.length prefix in
26+
let l = String.sub l len (String.length l - len) in
27+
Some (replacement ^ l)
28+
with Not_found -> None
2829

2930
let get_dir_and_file ~config url =
3031
let l = Url.Path.to_list url in

src/odoc/bin/main.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ module Odoc_html_args = struct
11801180
let convert_remap =
11811181
let parse inp =
11821182
match Astring.String.cut ~sep:":" inp with
1183-
| Some (orig, mapped) -> Ok (orig, mapped)
1183+
| Some (orig, mapped) -> Result.Ok (orig, mapped)
11841184
| _ -> Error (`Msg "Map must be of the form '<orig>:https://...'")
11851185
and print fmt (orig, mapped) = Format.fprintf fmt "%s:%s" orig mapped in
11861186
Arg.conv (parse, print)

0 commit comments

Comments
 (0)