Remove rabbit_queue_type:to_binary/1

As it is covered by rabbit_queue_type:short_alias_of/1
This commit is contained in:
Karl Nilsson 2025-03-24 14:56:29 +00:00
parent 73c6f9686f
commit 0410b7e4a6
2 changed files with 8 additions and 13 deletions

View File

@ -437,7 +437,13 @@ encode_queue(Q, NumMsgs, NumConsumers) ->
{{utf8, <<"durable">>}, {boolean, Durable}},
{{utf8, <<"auto_delete">>}, {boolean, AutoDelete}},
{{utf8, <<"exclusive">>}, {boolean, Exclusive}},
{{utf8, <<"type">>}, {utf8, rabbit_queue_type:to_binary(QType)}},
{{utf8, <<"type">>},
{utf8, case rabbit_queue_type:short_alias_of(QType) of
undefined ->
atom_to_binary(QType);
ShortName ->
ShortName
end}},
{{utf8, <<"arguments">>}, QArgs}
],
KVList1 = if is_list(Replicas) ->

View File

@ -20,7 +20,6 @@
close/1,
discover/1,
short_alias_of/1,
to_binary/1,
default/0,
default_alias/0,
fallback/0,
@ -299,7 +298,7 @@ discover(Other) when is_binary(Other) ->
{ok, Mod} = rabbit_registry:lookup_module(queue, T),
Mod.
-spec short_alias_of(queue_type()) -> binary().
-spec short_alias_of(queue_type()) -> undefined | binary().
%% The opposite of discover/1: returns a short alias given a module name
short_alias_of(<<"rabbit_quorum_queue">>) ->
<<"quorum">>;
@ -352,16 +351,6 @@ default() ->
default_alias() ->
short_alias_of(default()).
-spec to_binary(module()) -> binary().
to_binary(rabbit_classic_queue) ->
<<"classic">>;
to_binary(rabbit_quorum_queue) ->
<<"quorum">>;
to_binary(rabbit_stream_queue) ->
<<"stream">>;
to_binary(Other) ->
atom_to_binary(Other).
%% is a specific queue type implementation enabled
-spec is_enabled(module()) -> boolean().
is_enabled(Type) when is_atom(Type) ->