Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit 32ba560

Browse files
rabbit_misc:pget/{2,3}: move spec to the defition, use modern list type signature
1 parent 83ba37e commit 32ba560

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/rabbit_misc.erl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,7 @@
228228
-spec ntoa(inet:ip_address()) -> string().
229229
-spec ntoab(inet:ip_address()) -> string().
230230
-spec is_process_alive(pid()) -> boolean().
231-
-spec pget(term(), [term()]) -> term().
232-
-spec pget(term(), [term()], term()) -> term().
233-
-spec pget_or_die(term(), [term()]) -> term() | no_return().
231+
234232
-spec pmerge(term(), term(), [term()]) -> [term()].
235233
-spec plmerge([term()], [term()]) -> [term()].
236234
-spec pset(term(), term(), [term()]) -> [term()].
@@ -883,13 +881,16 @@ is_process_alive(Pid) ->
883881
lists:member(Node, [node() | nodes(connected)]) andalso
884882
rpc:call(Node, erlang, is_process_alive, [Pid]) =:= true.
885883

884+
-spec pget(term(), list()) -> term().
886885
pget(K, P) ->
887886
case lists:keyfind(K, 1, P) of
888887
{K, V} ->
889888
V;
890889
_ ->
891890
undefined
892891
end.
892+
893+
-spec pget(term(), list(), term()) -> term().
893894
pget(K, P, D) ->
894895
case lists:keyfind(K, 1, P) of
895896
{K, V} ->
@@ -898,6 +899,7 @@ pget(K, P, D) ->
898899
D
899900
end.
900901

902+
-spec pget_or_die(term(), list()) -> term() | no_return().
901903
pget_or_die(K, P) ->
902904
case proplists:get_value(K, P) of
903905
undefined -> exit({error, key_missing, K});

0 commit comments

Comments
 (0)