From 0a5403982eb4006f29cb2bfeb134999c3b75df0b Mon Sep 17 00:00:00 2001 From: Wilhelm Kirschbaum Date: Wed, 11 Dec 2024 01:30:36 +0200 Subject: [PATCH] fix: tag config_type response to avoid compilation warning (#281) This will only happen on Elixir 1.18. The solution was suggested here: https://github.com/elixir-lang/elixir/issues/14043 --- lib/pigeon/apns/config_parser.ex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pigeon/apns/config_parser.ex b/lib/pigeon/apns/config_parser.ex index e6948486..6dda1805 100644 --- a/lib/pigeon/apns/config_parser.ex +++ b/lib/pigeon/apns/config_parser.ex @@ -29,15 +29,15 @@ defmodule Pigeon.APNS.ConfigParser do reason: "configuration is invalid", config: opts - type -> + {:ok, type} -> type.new(opts) end end - @spec config_type(any) :: module | :error + @spec config_type(any) :: {:ok, module} | :error defp config_type(%{cert: _cert, key_identifier: _key_id}), do: :error - defp config_type(%{cert: _cert}), do: Config - defp config_type(%{key_identifier: _jwt_key}), do: JWTConfig + defp config_type(%{cert: _cert}), do: {:ok, Config} + defp config_type(%{key_identifier: _jwt_key}), do: {:ok, JWTConfig} defp config_type(_else), do: :error @doc false