Skip to content

Commit

Permalink
Fix deprecation warnings in latest inet_cidr
Browse files Browse the repository at this point in the history
warning: InetCidr.parse/2 is deprecated. Use `parse_cidr!/2` instead (or
`parse_cidr/2` for {:ok, {start,end,prefix}} / {:error,msg} tuples)
  • Loading branch information
ajvondrak committed Jun 9, 2024
1 parent 75e1245 commit 0774ff8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bench/check.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cidrs = Bench.Inputs.cidrs(1_000)

parsed_cidrs = %{
remote_ip: Enum.map(cidrs, &RemoteIp.Block.parse!/1),
inet_cidr: Enum.map(cidrs, &InetCidr.parse(&1, true)),
inet_cidr: Enum.map(cidrs, &InetCidr.parse_cidr!(&1, true)),
cider: Enum.map(cidrs, &Cider.parse/1),
cidr: Enum.map(cidrs, &CIDR.parse/1),
}
Expand Down
2 changes: 1 addition & 1 deletion bench/parse.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cidrs = Bench.Inputs.cidrs(1_000)

suite = %{
remote_ip: fn -> Enum.each(cidrs, &RemoteIp.Block.parse!/1) end,
inet_cidr: fn -> Enum.each(cidrs, &InetCidr.parse(&1, true)) end,
inet_cidr: fn -> Enum.each(cidrs, &InetCidr.parse_cidr!(&1, true)) end,
cider: fn -> Enum.each(cidrs, &Cider.parse/1) end,
cidr: fn -> Enum.each(cidrs, &CIDR.parse/1) end,
}
Expand Down

0 comments on commit 0774ff8

Please sign in to comment.