chore(style): fix elvis check for emqx_access_rule

This commit is contained in:
Zaiming Shi 2021-02-13 11:54:09 +01:00
parent 406a7d60c7
commit dc184574a3
1 changed files with 3 additions and 4 deletions

View File

@ -71,14 +71,13 @@ compile(topic, {eq, Topic}) ->
{eq, emqx_topic:words(bin(Topic))};
compile(topic, Topic) ->
Words = emqx_topic:words(bin(Topic)),
case 'pattern?'(Words) of
case pattern(Words) of
true -> {pattern, Words};
false -> Words
end.
'pattern?'(Words) ->
lists:member(<<"%u">>, Words)
orelse lists:member(<<"%c">>, Words).
pattern(Words) ->
lists:member(<<"%u">>, Words) orelse lists:member(<<"%c">>, Words).
bin(L) when is_list(L) ->
list_to_binary(L);