From 25e7b12a6bd870d96becbd79167818147f6b501c Mon Sep 17 00:00:00 2001 From: Phantasm Date: Mon, 12 May 2025 17:21:41 +0200 Subject: [PATCH] Elixir 1.18 Remove seemingly unneeded cond MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../web/activity_pub/object_validators/tag_validator.ex | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/pleroma/web/activity_pub/object_validators/tag_validator.ex b/lib/pleroma/web/activity_pub/object_validators/tag_validator.ex index 47cf7b415..411517045 100644 --- a/lib/pleroma/web/activity_pub/object_validators/tag_validator.ex +++ b/lib/pleroma/web/activity_pub/object_validators/tag_validator.ex @@ -50,12 +50,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.TagValidator do end def changeset(struct, %{"type" => "Hashtag", "name" => name} = data) do - name = - cond do - "#" <> name -> name - name -> name - end - |> String.downcase() + name = String.downcase(name) data = Map.put(data, "name", name)