Implement Path.explode_exn in terms of Path.explode
This commit is contained in:
parent
65385bbaa4
commit
46d74e1a96
|
@ -418,13 +418,10 @@ let explode t =
|
||||||
None
|
None
|
||||||
|
|
||||||
let explode_exn t =
|
let explode_exn t =
|
||||||
if is_root t then
|
match explode t with
|
||||||
[]
|
| Some s -> s
|
||||||
else if is_local t then
|
| None -> Exn.code_error "Path.explode_exn"
|
||||||
String.split t ~on:'/'
|
["path", Sexp.atom_or_quoted_string t]
|
||||||
else
|
|
||||||
Exn.code_error "Path.explode_exn"
|
|
||||||
["path", Sexp.atom_or_quoted_string t]
|
|
||||||
|
|
||||||
let exists t =
|
let exists t =
|
||||||
try Sys.file_exists (to_string t)
|
try Sys.file_exists (to_string t)
|
||||||
|
|
Loading…
Reference in New Issue