From 5fa479f420c8af8c3680d384f856f0a3905365e9 Mon Sep 17 00:00:00 2001 From: Oleksii Sholik Date: Fri, 24 May 2024 23:58:09 +0300 Subject: [PATCH] Replace the deprecated :code.lib_dir/2 function See https://www.erlang.org/doc/apps/kernel/code.html#lib_dir/2 --- lib/benchee/system.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/benchee/system.ex b/lib/benchee/system.ex index 2bd49b1d..79936bf1 100644 --- a/lib/benchee/system.ex +++ b/lib/benchee/system.ex @@ -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) -> @@ -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