Elixir 1.18 Remove seemingly unneeded cond
warning: this clause in cond will always match:
<<"#", name::binary>>
since it has type:
binary()
where "name" was given the type:
%{"type" => "Hashtag", "name" => name} = data
typing violation found at:
│
55 │ "#" <> name -> name
│ ~
│
└─ lib/pleroma/web/activity_pub/object_validators/tag_validator.ex:55:21: Pleroma.Web.ActivityPub.ObjectValidators.TagValidator.changeset/2
This commit is contained in:
parent
53d7b205e8
commit
25e7b12a6b
1 changed files with 1 additions and 6 deletions
|
|
@ -50,12 +50,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.TagValidator do
|
||||||
end
|
end
|
||||||
|
|
||||||
def changeset(struct, %{"type" => "Hashtag", "name" => name} = data) do
|
def changeset(struct, %{"type" => "Hashtag", "name" => name} = data) do
|
||||||
name =
|
name = String.downcase(name)
|
||||||
cond do
|
|
||||||
"#" <> name -> name
|
|
||||||
name -> name
|
|
||||||
end
|
|
||||||
|> String.downcase()
|
|
||||||
|
|
||||||
data = Map.put(data, "name", name)
|
data = Map.put(data, "name", name)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue