Skip to content

Commit e93b8f2

Browse files
author
Simon MacMullen
committed
Fix type of inner_fun, cosmetics.
1 parent 9957155 commit e93b8f2

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/rabbit_channel.erl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,7 @@ binding_action(Fun, ExchangeNameBin, QueueNameBin, RoutingKey, Arguments,
911911
check_read_permitted(ExchangeName, State),
912912
case Fun(ExchangeName, QueueName, ActualRoutingKey, Arguments,
913913
fun (_X, Q) ->
914-
try
915-
rabbit_amqqueue:check_exclusive_access(Q, ReaderPid)
914+
try rabbit_amqqueue:check_exclusive_access(Q, ReaderPid)
916915
catch exit:Reason -> {error, Reason}
917916
end
918917
end) of
@@ -929,7 +928,7 @@ binding_action(Fun, ExchangeNameBin, QueueNameBin, RoutingKey, Arguments,
929928
not_found, "no binding ~s between ~s and ~s",
930929
[RoutingKey, rabbit_misc:rs(ExchangeName),
931930
rabbit_misc:rs(QueueName)]);
932-
%% When check_exclusive_access exits with a protocal error this gets
931+
%% When check_exclusive_access exits with a protocol error this gets
933932
%% wrapped by mnesia. Unwrap it and exit again.
934933
{error, {amqp_error, _, _, _} = Error} ->
935934
exit(Error);

src/rabbit_exchange.erl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@
6464
-type(bind_res() :: rabbit_types:ok_or_error('queue_not_found' |
6565
'exchange_not_found' |
6666
'exchange_and_queue_not_found')).
67-
-type(inner_fun() :: fun((rabbit_types:exchange(), queue()) ->
68-
rabbit_types:ok_or_error('amqp_error'))).
67+
-type(inner_fun() ::
68+
fun((rabbit_types:exchange(), queue()) ->
69+
rabbit_types:ok_or_error(rabbit_types:amqp_error()))).
6970

7071
-spec(recover/0 :: () -> 'ok').
7172
-spec(declare/5 ::
@@ -440,7 +441,8 @@ add_binding(ExchangeName, QueueName, RoutingKey, Arguments, InnerFun) ->
440441
[_R] ->
441442
{existing, X, B}
442443
end;
443-
{error, _} = E -> E
444+
{error, _} = E ->
445+
E
444446
end
445447
end) of
446448
{new, Exchange = #exchange{ type = Type }, Binding} ->
@@ -457,7 +459,8 @@ delete_binding(ExchangeName, QueueName, RoutingKey, Arguments, InnerFun) ->
457459
fun (X, Q, B) ->
458460
case mnesia:match_object(rabbit_route, #route{binding = B},
459461
write) of
460-
[] -> {error, binding_not_found};
462+
[] ->
463+
{error, binding_not_found};
461464
_ ->
462465
case InnerFun(X, Q) of
463466
ok ->
@@ -467,7 +470,8 @@ delete_binding(ExchangeName, QueueName, RoutingKey, Arguments, InnerFun) ->
467470
Q#amqqueue.durable,
468471
fun mnesia:delete_object/3),
469472
{maybe_auto_delete(X), B};
470-
{error, _} = E -> E
473+
{error, _} = E ->
474+
E
471475
end
472476
end
473477
end) of

0 commit comments

Comments
 (0)