Simplify recent commit (thanks to Simon Lipp)(#3894)

This commit is contained in:
Badlop 2022-09-06 17:41:09 +02:00
parent f542a82309
commit 17a5835143
1 changed files with 2 additions and 4 deletions

View File

@ -220,15 +220,13 @@ encode_base64(Data) ->
-spec ip_to_list(inet:ip_address() | undefined |
{inet:ip_address(), inet:port_number()}) -> binary().
ip_to_list({local, _}) ->
<<"unix">>;
ip_to_list(local) ->
<<"unix">>;
ip_to_list({IP, _Port}) ->
ip_to_list(IP);
%% This function clause could use inet_parse too:
ip_to_list(undefined) ->
<<"unknown">>;
ip_to_list(local) ->
<<"unix">>;
ip_to_list(IP) ->
list_to_binary(inet_parse:ntoa(IP)).