mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-01 03:46:44 +01:00
Fix type system warning
This commit is contained in:
parent
b3c5396a45
commit
02014c4cdf
1 changed files with 6 additions and 4 deletions
|
@ -91,7 +91,7 @@ defmodule PhilomenaMedia.Processors do
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Returns a processor, with the processor being a module capable
|
Returns a processor, with the processor being a module capable
|
||||||
of processing this content type, or nil.
|
of processing this content type.
|
||||||
|
|
||||||
The allowed MIME types are:
|
The allowed MIME types are:
|
||||||
- `image/gif`
|
- `image/gif`
|
||||||
|
@ -111,10 +111,10 @@ defmodule PhilomenaMedia.Processors do
|
||||||
PhilomenaMedia.Processors.Png
|
PhilomenaMedia.Processors.Png
|
||||||
|
|
||||||
iex> PhilomenaMedia.Processors.processor("application/octet-stream")
|
iex> PhilomenaMedia.Processors.processor("application/octet-stream")
|
||||||
nil
|
** (ArgumentError) invalid content type application/octet-stream
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@spec processor(Mime.t()) :: module() | nil
|
@spec processor(Mime.t()) :: module()
|
||||||
def processor(content_type)
|
def processor(content_type)
|
||||||
|
|
||||||
def processor("image/gif"), do: Gif
|
def processor("image/gif"), do: Gif
|
||||||
|
@ -122,7 +122,9 @@ defmodule PhilomenaMedia.Processors do
|
||||||
def processor("image/png"), do: Png
|
def processor("image/png"), do: Png
|
||||||
def processor("image/svg+xml"), do: Svg
|
def processor("image/svg+xml"), do: Svg
|
||||||
def processor("video/webm"), do: Webm
|
def processor("video/webm"), do: Webm
|
||||||
def processor(_content_type), do: nil
|
|
||||||
|
def processor(content_type),
|
||||||
|
do: raise(ArgumentError, message: "invalid content type #{content_type}")
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Takes a MIME type and filtered version list and generates a list of version files to be
|
Takes a MIME type and filtered version list and generates a list of version files to be
|
||||||
|
|
Loading…
Reference in a new issue