fix(emqx_rule_utils): fix Dialyzer warnings

This commit is contained in:
ayodele.akingbule 2020-12-11 12:47:39 +01:00
parent fe96be108c
commit 8ee98e3f20
1 changed files with 2 additions and 0 deletions

View File

@ -122,10 +122,12 @@ proc_cmd(Tokens, Data, Opts) ->
%% preprocess SQL with place holders %% preprocess SQL with place holders
-spec(preproc_sql(Sql::binary()) -> {prepare_statement(), prepare_params()}). -spec(preproc_sql(Sql::binary()) -> {prepare_statement(), prepare_params()}).
-dialyzer({nowarn_function,preproc_sql/1}).
preproc_sql(Sql) -> preproc_sql(Sql) ->
preproc_sql(Sql, '?'). preproc_sql(Sql, '?').
-spec(preproc_sql(Sql::binary(), ReplaceWith :: '?' | '$n') -> {prepare_statement(), prepare_params()}). -spec(preproc_sql(Sql::binary(), ReplaceWith :: '?' | '$n') -> {prepare_statement(), prepare_params()}).
-dialyzer({nowarn_function,preproc_sql/2}).
preproc_sql(Sql, ReplaceWith) -> preproc_sql(Sql, ReplaceWith) ->
case re:run(Sql, ?EX_PLACE_HOLDER, [{capture, all_but_first, binary}, global]) of case re:run(Sql, ?EX_PLACE_HOLDER, [{capture, all_but_first, binary}, global]) of
{match, PlaceHolders} -> {match, PlaceHolders} ->