Skip to content

Commit

Permalink
Fix Re.get deprecation warnings
Browse files Browse the repository at this point in the history
Changed calls from `Re.get` to `Re.Group.get` to avoid deprecation
warnings.
  • Loading branch information
senior committed Jul 8, 2019
1 parent 03249c5 commit f87475d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pgx/src/pgx_value.ml
Expand Up @@ -135,11 +135,11 @@ let to_inet' =
fun str ->
try
let subs = Re.exec re str in
let addr = Unix.inet_addr_of_string (Re.get subs 1) in
let addr = Unix.inet_addr_of_string (Re.Group.get subs 1) in
(* optional match *)
let mask = try (Re.get subs 3) with Not_found -> "" in
let mask = try (Re.Group.get subs 3) with Not_found -> "" in
if mask = ""
then (addr, (if (Re.get subs 2) = "." then 32 else 128))
then (addr, (if (Re.Group.get subs 2) = "." then 32 else 128))
else (addr, int_of_string mask)
with _ -> convert_failure "inet" str

Expand Down Expand Up @@ -258,7 +258,7 @@ let to_point' =
fun str ->
try
let subs = Re.exec point_re str in
(float_of_string (Re.get subs 1), float_of_string (Re.get subs 2))
(float_of_string (Re.Group.get subs 1), float_of_string (Re.Group.get subs 2))
with
| e -> Printexc.to_string e |> print_endline; convert_failure "point" str

Expand Down

0 comments on commit f87475d

Please sign in to comment.