Skip to content

Commit

Permalink
fix: restrict typespec
Browse files Browse the repository at this point in the history
  • Loading branch information
ahamez committed Nov 1, 2024
1 parent 926f117 commit 69c35da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/protox/json_decode.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion lib/protox/json_message_decoder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 69c35da

Please sign in to comment.