summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2015-08-07 12:59:51 +0200
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2015-08-07 12:59:51 +0200
commit804a2209b4c8c540559c06f2c9d1544c609f1624 (patch)
tree93e7fc068aa8bce9814c4ce51b2350a2a4228368 /src
parente2b7de27cc6c55e430882621a4545dcfdd901e95 (diff)
downloadrabbitmq-server-git-804a2209b4c8c540559c06f2c9d1544c609f1624.tar.gz
Warn about exported variables
Fix the reported warning in `credit_flow.erl` and `rabbit_table.erl`. This is the default setting in erlang.mk, so fixing this directly in RabbitMQ will ease future work on erlang.mk or Rebar.
Diffstat (limited to 'src')
-rw-r--r--src/credit_flow.erl6
-rw-r--r--src/rabbit_table.erl9
2 files changed, 9 insertions, 6 deletions
diff --git a/src/credit_flow.erl b/src/credit_flow.erl
index 6b24175388..e7f13a66dc 100644
--- a/src/credit_flow.erl
+++ b/src/credit_flow.erl
@@ -61,9 +61,9 @@
%% We deliberately allow Var to escape from the case here
%% to be used in Expr. Any temporary var we introduced
%% would also escape, and might conflict.
- case get(Key) of
- undefined -> Var = Default;
- Var -> ok
+ Var = case get(Key) of
+ undefined -> Default;
+ V -> V
end,
put(Key, Expr)
end).
diff --git a/src/rabbit_table.erl b/src/rabbit_table.erl
index e716345b85..a873a714e1 100644
--- a/src/rabbit_table.erl
+++ b/src/rabbit_table.erl
@@ -189,9 +189,12 @@ check_content(Tab, TabDef) ->
check(Fun) ->
case [Error || {Tab, TabDef} <- definitions(),
- case Fun(Tab, TabDef) of
- ok -> Error = none, false;
- {error, Error} -> true
+ begin
+ {Ret, Error} = case Fun(Tab, TabDef) of
+ ok -> {false, none};
+ {error, E} -> {true, E}
+ end,
+ Ret
end] of
[] -> ok;
Errors -> {error, Errors}