Upload.Filter: use generic types in @spec
Speeds up recompilation by reducing compile-time deps
This commit is contained in:
parent
4a6b49d0b4
commit
bdaa1d4512
@ -15,13 +15,13 @@ defmodule Pleroma.Upload.Filter do
|
|||||||
|
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
@callback filter(Pleroma.Upload.t()) ::
|
@callback filter(upload :: struct()) ::
|
||||||
{:ok, :filtered}
|
{:ok, :filtered}
|
||||||
| {:ok, :noop}
|
| {:ok, :noop}
|
||||||
| {:ok, :filtered, Pleroma.Upload.t()}
|
| {:ok, :filtered, upload :: struct()}
|
||||||
| {:error, any()}
|
| {:error, any()}
|
||||||
|
|
||||||
@spec filter([module()], Pleroma.Upload.t()) :: {:ok, Pleroma.Upload.t()} | {:error, any()}
|
@spec filter([module()], upload :: struct()) :: {:ok, upload :: struct()} | {:error, any()}
|
||||||
|
|
||||||
def filter([], upload) do
|
def filter([], upload) do
|
||||||
{:ok, upload}
|
{:ok, upload}
|
||||||
|
Loading…
Reference in New Issue
Block a user