summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Hood <0x6e6562@gmail.com>2008-08-06 15:23:36 +0100
committerBen Hood <0x6e6562@gmail.com>2008-08-06 15:23:36 +0100
commit2bf27f8cf7adc9aabd10f8249e76830b077a757e (patch)
treee8adba2c3cf8bf6e91f18abeaf9819186667340d /src
parent37513d69c29d0c413ab87b20073c7cf9520f5aa2 (diff)
downloadrabbitmq-server-git-2bf27f8cf7adc9aabd10f8249e76830b077a757e.tar.gz
Fixing some QA remarks
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue.erl4
-rw-r--r--src/rabbit_exchange.erl6
-rw-r--r--src/rabbit_misc.erl18
3 files changed, 16 insertions, 12 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index ba65135867..d481010553 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -363,8 +363,8 @@ on_node_down(Node) ->
node(Pid) == Node]))
end).
-pseudo_queue(NameBin, Pid) ->
- #amqqueue{name = NameBin,
+pseudo_queue(Resource = #resource{}, Pid) ->
+ #amqqueue{name = Resource,
durable = false,
auto_delete = false,
arguments = [],
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl
index c1a40394c0..d0f3f80a2b 100644
--- a/src/rabbit_exchange.erl
+++ b/src/rabbit_exchange.erl
@@ -131,12 +131,12 @@ assert_type(#exchange{ name = Name, type = ActualType }, RequiredType) ->
lookup(Name) ->
rabbit_misc:dirty_read({exchange, Name}).
-lookup_or_die(Resource = #resource{name = Name}) ->
- case lookup(Resource) of
+lookup_or_die(Name) ->
+ case lookup(Name) of
{ok, X} -> X;
{error, not_found} ->
rabbit_misc:protocol_error(
- not_found, "no ~s", [rabbit_misc:rs(#resource{virtual_host = <<"/">>, kind = exchange, name = Name})])
+ not_found, "no ~s", [rabbit_misc:rs(Name)])
end.
list_vhost_exchanges(VHostPath) ->
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index c78a4ec38b..6d501fe2fd 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -66,6 +66,10 @@
-spec(get_config/2 :: (atom(), A) -> A).
-spec(set_config/2 :: (atom(), any()) -> 'ok').
-spec(dirty_read/1 :: ({atom(), any()}) -> {'ok', any()} | not_found()).
+-spec(r/3 :: (#resource{virtual_host :: vhost(),
+ kind :: K,
+ name :: '_' | vhost(), K, name()) ->
+ r(K) when is_subtype(K, atom())).
-spec(r/2 :: (vhost(), K) -> #resource{virtual_host :: vhost(),
kind :: K,
name :: '_'}
@@ -73,16 +77,16 @@
-spec(rs/1 :: (r(atom())) -> string()).
-spec(enable_cover/0 :: () -> 'ok' | {'error', any()}).
-spec(report_cover/0 :: () -> 'ok').
--spec(with_exit_handler/2 :: (thunk(A), thunk(A)) -> A).
--spec(with_user/2 :: (username(), thunk(A)) -> A).
+-spec(with_exit_handler/2 :: (thunk(A), thunk(A)) -> A).
+-spec(with_user/2 :: (username(), thunk(A)) -> A).
-spec(with_vhost/2 :: (vhost(), thunk(A)) -> A).
--spec(with_user_and_vhost/3 :: (username(), vhost(), thunk(A)) -> A).
+-spec(with_user_and_vhost/3 :: (username(), vhost(), thunk(A)) -> A).
-spec(execute_mnesia_transaction/1 :: (thunk(A)) -> A).
--spec(ensure_ok/2 :: ('ok' | {'error', any()}, atom()) -> 'ok').
+-spec(ensure_ok/2 :: ('ok' | {'error', any()}, atom()) -> 'ok').
-spec(localnode/1 :: (atom()) -> node()).
--spec(tcp_name/3 :: (atom(), ip_address(), ip_port()) -> atom()).
+-spec(tcp_name/3 :: (atom(), ip_address(), ip_port()) -> atom()).
-spec(intersperse/2 :: (A, [A]) -> [A]).
--spec(upmap/2 :: (fun ((A) -> B), [A]) -> [B]).
+-spec(upmap/2 :: (fun ((A) -> B), [A]) -> [B]).
-spec(map_in_order/2 :: (fun ((A) -> B), [A]) -> [B]).
-spec(guid/0 :: () -> guid()).
-spec(string_guid/1 :: (any()) -> string()).
@@ -213,7 +217,7 @@ with_user(Username, Thunk) ->
with_vhost(VHostPath, Thunk) ->
fun () ->
case mnesia:read({vhost, VHostPath}) of
- [] ->
+ [] ->
mnesia:abort({no_such_vhost, VHostPath});
[_V] ->
Thunk()