Skip to content

Commit

Permalink
Replace the deprecated :code.lib_dir/2 function
Browse files Browse the repository at this point in the history
  • Loading branch information
alco authored and PragTob committed May 25, 2024
1 parent 2b324db commit 5fa479f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/benchee/system.ex
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ defmodule Benchee.System do

# just made public for easy testing purposes
@doc false
def all_protocols_consolidated?(lib_dir_fun \\ &:code.lib_dir/2) do
def all_protocols_consolidated?(lib_dir_fun \\ &lib_dir/2) do
case lib_dir_fun.(:elixir, :ebin) do
# do we get a good old erlang charlist?
path when is_list(path) ->
Expand All @@ -271,6 +271,8 @@ defmodule Benchee.System do
true
end
end

defp lib_dir(app, subdir), do: Path.join(:code.lib_dir(app), subdir)
end

defimpl DeepMerge.Resolver, for: Benchee.System do
Expand Down

0 comments on commit 5fa479f

Please sign in to comment.