fix: elvis warning

This commit is contained in:
Zhongwen Deng 2022-03-21 10:41:52 +08:00
parent f051424b3b
commit 267fd398a6
2 changed files with 4 additions and 6 deletions

View File

@ -107,7 +107,7 @@
%% limiter timers
limiter_timer :: undefined | reference()
}).
}).
-record(retry, { types :: list(limiter_type())
, data :: any()

View File

@ -310,11 +310,9 @@ gen_id(Len) ->
int_to_hex(R, Len).
-spec clamp(number(), number(), number()) -> number().
clamp(Val, Min, Max) ->
if Val < Min -> Min;
Val > Max -> Max;
true -> Val
end.
clamp(Val, Min, _Max) when Val < Min -> Min;
clamp(Val, _Min, Max) when Val > Max -> Max;
clamp(Val, _Min, _Max) -> Val.
%% @doc https://www.erlang.org/doc/man/file.html#posix-error-codes
explain_posix(eacces) -> "Permission denied";