From 69c35da7bee2584c78316e91890a2e3f2d2b5252 Mon Sep 17 00:00:00 2001 From: Alexandre Hamez Date: Fri, 1 Nov 2024 08:30:14 +0100 Subject: [PATCH] fix: restrict typespec --- lib/protox/json_decode.ex | 2 +- lib/protox/json_message_decoder.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/protox/json_decode.ex b/lib/protox/json_decode.ex index c19a6ae8..5008030d 100644 --- a/lib/protox/json_decode.ex +++ b/lib/protox/json_decode.ex @@ -7,7 +7,7 @@ defmodule Protox.JsonDecode do use Protox.{Float, Integer} - @spec decode!(iodata(), atom(), fun()) :: any() | no_return() + @spec decode!(iodata(), atom(), fun()) :: struct() | no_return() def decode!(input, mod, json_decode) do case json_decode.(input) do nil -> raise JsonDecodingError.new("invalid top-level null") diff --git a/lib/protox/json_message_decoder.ex b/lib/protox/json_message_decoder.ex index 33c0d981..05f50177 100644 --- a/lib/protox/json_message_decoder.ex +++ b/lib/protox/json_message_decoder.ex @@ -5,7 +5,7 @@ defprotocol Protox.JsonMessageDecoder do @doc since: "1.6.0" @fallback_to_any true - # @spec decode_message(atom(), struct()) :: struct() + @spec decode_message(struct(), any()) :: struct() def decode_message(initial_message, json) end