Browse Source

Fix some dialyzer warnings

Also turning of -Wunderspecs for now. This warns for spec'd internal
functions if the spec is too broad.
Seth Falcon 13 years ago
parent
commit
178a547107
2 changed files with 3 additions and 3 deletions
  1. 1 1
      Makefile
  2. 2 2
      src/pooler.erl

+ 1 - 1
Makefile

@@ -10,7 +10,7 @@ test:
 	@./rebar eunit skip_deps=true
 
 dialyzer: all
-	@dialyzer -Wrace_conditions -Wunderspecs -r ebin
+	@dialyzer -Wrace_conditions -r ebin
 
 doc:
 	@./rebar doc skip_deps=true

+ 2 - 2
src/pooler.erl

@@ -476,7 +476,7 @@ do_n(N, Fun, Acc) ->
     do_n(N - 1, Fun, Fun(Acc)).
 
 
--spec fetch_pool(string(), dict()) -> #pool{}.
+-spec fetch_pool(string(), dict()) -> #pool{} | error_no_pool.
 fetch_pool(PoolName, Pools) ->
     case dict:find(PoolName, Pools) of
         {ok, Pool} -> Pool;
@@ -547,7 +547,7 @@ send_metric(Name, Value, Type) ->
     end,
     ok.
 
--spec pool_metric(string(), string() | binary()) -> binary().
+-spec pool_metric(string(), atom()) -> binary().
 pool_metric(PoolName, Metric) ->
     iolist_to_binary([<<"pooler.">>, PoolName, ".",
                       atom_to_binary(Metric, utf8)]).