fix(ft): fix dialyzer issues

This commit is contained in:
Ilya Averyanov 2023-05-09 12:19:55 +05:00
parent 079b8e9476
commit 9381c895bb
1 changed files with 3 additions and 9 deletions

View File

@ -131,12 +131,8 @@ files(Query) ->
-spec dispatch(atom(), list(term())) -> any().
dispatch(Fun, Args) when is_atom(Fun) ->
case backend() of
{Type, Storage} ->
apply(mod(Type), Fun, [Storage | Args]);
_ ->
{error, disabled}
end.
{Type, Storage} = backend(),
apply(mod(Type), Fun, [Storage | Args]).
%%
@ -152,9 +148,7 @@ with_storage_type(Type, Fun, Args) ->
{Type, Storage} when is_function(Fun) ->
apply(Fun, [Storage | Args]);
{_, _} = Backend ->
{error, {invalid_storage_backend, Backend}};
_ ->
{error, disabled}
{error, {invalid_storage_backend, Backend}}
end.
%%