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))}; {eq, emqx_topic:words(bin(Topic))};
compile(topic, Topic) -> compile(topic, Topic) ->
Words = emqx_topic:words(bin(Topic)), Words = emqx_topic:words(bin(Topic)),
case 'pattern?'(Words) of case pattern(Words) of
true -> {pattern, Words}; true -> {pattern, Words};
false -> Words false -> Words
end. end.
'pattern?'(Words) -> pattern(Words) ->
lists:member(<<"%u">>, Words) lists:member(<<"%u">>, Words) orelse lists:member(<<"%c">>, Words).
orelse lists:member(<<"%c">>, Words).
bin(L) when is_list(L) -> bin(L) when is_list(L) ->
list_to_binary(L); list_to_binary(L);