From: Alex Gleason Date: Mon, 7 Jun 2021 22:07:40 +0000 (-0500) Subject: Upload.Filter: use generic types in @spec X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=bdaa1d45123ae8dd7f0138aa09b96d3104e1e58e;p=akkoma Upload.Filter: use generic types in @spec Speeds up recompilation by reducing compile-time deps --- diff --git a/lib/pleroma/upload/filter.ex b/lib/pleroma/upload/filter.ex index c677d4b9f..e5db2fb20 100644 --- a/lib/pleroma/upload/filter.ex +++ b/lib/pleroma/upload/filter.ex @@ -15,13 +15,13 @@ defmodule Pleroma.Upload.Filter do require Logger - @callback filter(Pleroma.Upload.t()) :: + @callback filter(upload :: struct()) :: {:ok, :filtered} | {:ok, :noop} - | {:ok, :filtered, Pleroma.Upload.t()} + | {:ok, :filtered, upload :: struct()} | {: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 {:ok, upload}