File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -15,16 +15,17 @@ module Path = struct
15
15
16
16
let remap config f =
17
17
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
28
29
29
30
let get_dir_and_file ~config url =
30
31
let l = Url.Path. to_list url in
Original file line number Diff line number Diff line change @@ -1180,7 +1180,7 @@ module Odoc_html_args = struct
1180
1180
let convert_remap =
1181
1181
let parse inp =
1182
1182
match Astring.String. cut ~sep: " :" inp with
1183
- | Some (orig , mapped ) -> Ok (orig, mapped)
1183
+ | Some (orig , mapped ) -> Result. Ok (orig, mapped)
1184
1184
| _ -> Error (`Msg " Map must be of the form '<orig>:https://...'" )
1185
1185
and print fmt (orig , mapped ) = Format. fprintf fmt " %s:%s" orig mapped in
1186
1186
Arg. conv (parse, print)
You can’t perform that action at this time.
0 commit comments