summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2011-03-30 07:40:55 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2011-03-30 07:40:55 +0100
commit3418e5cf5e1de222d19c1984e9cad0fac2a90bf1 (patch)
tree5510246d866c5f5ce4c2faf1ae4cd196dada9d9f
parent713ee0002753f3278b1a4198f7d7101a2e820007 (diff)
downloadrabbitmq-server-3418e5cf5e1de222d19c1984e9cad0fac2a90bf1.tar.gz
simplify: rabbit_misc:const/1 and thunk/1 types are identical
get rid of former
-rw-r--r--src/rabbit_binding.erl6
-rw-r--r--src/rabbit_misc.erl5
2 files changed, 5 insertions, 6 deletions
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl
index d1e6f220..534233c1 100644
--- a/src/rabbit_binding.erl
+++ b/src/rabbit_binding.erl
@@ -44,9 +44,9 @@
rabbit_types:exchange() | rabbit_types:amqqueue()) ->
rabbit_types:ok_or_error(rabbit_types:amqp_error()))).
-type(bindings() :: [rabbit_types:binding()]).
--type(add_res() :: bind_res() | rabbit_misc:const(bind_res())).
+-type(add_res() :: bind_res() | rabbit_misc:thunk(bind_res())).
-type(bind_or_error() :: bind_res() | rabbit_types:error('binding_not_found')).
--type(remove_res() :: bind_or_error() | rabbit_misc:const(bind_or_error())).
+-type(remove_res() :: bind_or_error() | rabbit_misc:thunk(bind_or_error())).
-opaque(deletions() :: dict()).
@@ -77,7 +77,7 @@
(rabbit_types:binding_destination()) -> deletions()).
-spec(remove_transient_for_destination/1 ::
(rabbit_types:binding_destination()) -> deletions()).
--spec(process_deletions/1 :: (deletions()) -> rabbit_misc:const('ok')).
+-spec(process_deletions/1 :: (deletions()) -> rabbit_misc:thunk('ok')).
-spec(combine_deletions/2 :: (deletions(), deletions()) -> deletions()).
-spec(add_deletion/3 :: (rabbit_exchange:name(),
{'undefined' | rabbit_types:exchange(),
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index 7d3476e6..ad59edae 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -62,11 +62,10 @@
-ifdef(use_specs).
--export_type([resource_name/0, thunk/1, const/1]).
+-export_type([resource_name/0, thunk/1]).
-type(ok_or_error() :: rabbit_types:ok_or_error(any())).
-type(thunk(T) :: fun(() -> T)).
--type(const(T) :: fun(() -> T)).
-type(resource_name() :: binary()).
-type(optdef() :: {flag, string()} | {option, string(), any()}).
-type(channel_or_connection_exit()
@@ -192,7 +191,7 @@
-spec(now_ms/0 :: () -> non_neg_integer()).
-spec(lock_file/1 :: (file:filename()) -> rabbit_types:ok_or_error('eexist')).
-spec(const_ok/0 :: () -> 'ok').
--spec(const/1 :: (A) -> const(A)).
+-spec(const/1 :: (A) -> thunk(A)).
-spec(ntoa/1 :: (inet:ip_address()) -> string()).
-spec(ntoab/1 :: (inet:ip_address()) -> string()).
-spec(is_process_alive/1 :: (pid()) -> boolean()).