Pleroma.Web.ControllerHelper: fix @spec to resolve dialyzer errors
lib/pleroma/web/admin_api/controllers/user_controller.ex:333:no_return Function index/2 has no local return. ________________________________________________________________________________ lib/pleroma/web/admin_api/controllers/user_controller.ex:357:unused_fun Function maybe_parse_filters/1 will never be called. ________________________________________________________________________________ lib/pleroma/web/admin_api/controllers/user_controller.ex:366:no_return Function page_params/1 has no local return. ________________________________________________________________________________ lib/pleroma/web/admin_api/controllers/user_controller.ex:368:call The function call will not succeed. Pleroma.Web.ControllerHelper.fetch_integer_param(_params :: any(), :page, 1) breaks the contract (map(), String.t(), integer() | nil) :: integer() | nil
This commit is contained in:
parent
3b9d991514
commit
c6f783c551
@ -20,7 +20,7 @@ defmodule Pleroma.Web.ControllerHelper do
|
|||||||
|> json(json)
|
|> json(json)
|
||||||
end
|
end
|
||||||
|
|
||||||
@spec fetch_integer_param(map(), String.t(), integer() | nil) :: integer() | nil
|
@spec fetch_integer_param(map(), String.t() | atom(), integer() | nil) :: integer() | nil
|
||||||
def fetch_integer_param(params, name, default \\ nil) do
|
def fetch_integer_param(params, name, default \\ nil) do
|
||||||
params
|
params
|
||||||
|> Map.get(name, default)
|
|> Map.get(name, default)
|
||||||
|
Loading…
Reference in New Issue
Block a user