From ff62baa6e78d8b2941482a421282d385dd18ffa6 Mon Sep 17 00:00:00 2001 From: edgurgel Date: Sun, 18 Aug 2024 10:13:29 +1200 Subject: [PATCH] Use Macro.generate_arguments/2 --- lib/mimic/module.ex | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/mimic/module.ex b/lib/mimic/module.ex index 87b1893..e9fa143 100644 --- a/lib/mimic/module.ex +++ b/lib/mimic/module.ex @@ -141,11 +141,7 @@ defmodule Mimic.Module do for {fn_name, arity} <- module.module_info(:exports), {fn_name, arity} not in internal_functions do - args = - 0..arity - |> Enum.to_list() - |> tl() - |> Enum.map(&Macro.var(String.to_atom("arg_#{&1}"), Elixir)) + args = Macro.generate_arguments(arity, module) quote do def unquote(fn_name)(unquote_splicing(args)) do