Skip to content

Commit

Permalink
Keep backward compatibility
Browse files Browse the repository at this point in the history
Otherwise whoever's using keys as binaries
already, which is working, would see their
code fail for "no reason"
  • Loading branch information
paulo-ferraz-oliveira committed Jun 16, 2024
1 parent 354a98c commit 58e2aa0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hex_api_release.erl
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,16 @@ retire(Config, Name, Version, Params0) when
Params = maps:fold(
fun (K, V, AccIn) ->
AccIn#{
atom_to_binary(K) => V
maybe_atom_to_binary(K) => V
}
end,
#{},
Params0),
hex_api:post(Config, Path, Params).

maybe_atom_to_binary(K) when is_binary(K) -> K;
maybe_atom_to_binary(K) -> atom_to_binary(K).

%% @doc
%% Unretires a package release.
%%
Expand Down

0 comments on commit 58e2aa0

Please sign in to comment.