Dialyzer: fix pattern match coverage
This commit is contained in:
parent
7f649a7a19
commit
88042109a3
@ -8,10 +8,12 @@ defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.BareUri do
|
|||||||
def type, do: :string
|
def type, do: :string
|
||||||
|
|
||||||
def cast(uri) when is_binary(uri) do
|
def cast(uri) when is_binary(uri) do
|
||||||
case URI.parse(uri) do
|
parsed = URI.parse(uri)
|
||||||
%URI{scheme: nil} -> :error
|
|
||||||
%URI{} -> {:ok, uri}
|
if is_nil(parsed.scheme) do
|
||||||
_ -> :error
|
:error
|
||||||
|
else
|
||||||
|
{:ok, uri}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user