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