From 69482004fc68174286e44010c816003aaa8868ce Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Mon, 1 Jul 2024 10:58:22 -0400 Subject: [PATCH] Dialyzer: pattern can never match the type because it is covered by previous clauses. --- lib/pleroma/frontend.ex | 4 ---- lib/pleroma/web/activity_pub/activity_pub.ex | 1 - lib/pleroma/web/activity_pub/mrf/nsfw_api_policy.ex | 1 - lib/pleroma/web/activity_pub/mrf/simple_policy.ex | 3 --- lib/pleroma/web/activity_pub/mrf/vocabulary_policy.ex | 1 - lib/pleroma/web/admin_api/controllers/invite_controller.ex | 1 - lib/pleroma/web/common_api.ex | 1 - lib/pleroma/web/twitter_api/controllers/util_controller.ex | 3 --- 8 files changed, 15 deletions(-) diff --git a/lib/pleroma/frontend.ex b/lib/pleroma/frontend.ex index ec72fb6a4..816499917 100644 --- a/lib/pleroma/frontend.ex +++ b/lib/pleroma/frontend.ex @@ -43,10 +43,6 @@ defmodule Pleroma.Frontend do {:download_or_unzip, _} -> Logger.info("Could not download or unzip the frontend") {:error, "Could not download or unzip the frontend"} - - _e -> - Logger.info("Could not install the frontend") - {:error, "Could not install the frontend"} end end diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 6c1d6ded9..b30b0cabe 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -1661,7 +1661,6 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do }} else {:error, _} = e -> e - e -> {:error, e} end end diff --git a/lib/pleroma/web/activity_pub/mrf/nsfw_api_policy.ex b/lib/pleroma/web/activity_pub/mrf/nsfw_api_policy.ex index 3d1c273b9..451a212d4 100644 --- a/lib/pleroma/web/activity_pub/mrf/nsfw_api_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/nsfw_api_policy.ex @@ -137,7 +137,6 @@ defmodule Pleroma.Web.ActivityPub.MRF.NsfwApiPolicy do {:ok, object} else {:nsfw, _data} -> handle_nsfw(object) - _ -> {:reject, "NSFW: Attachment rejected"} end end diff --git a/lib/pleroma/web/activity_pub/mrf/simple_policy.ex b/lib/pleroma/web/activity_pub/mrf/simple_policy.ex index 829ddeaea..8e3021ae6 100644 --- a/lib/pleroma/web/activity_pub/mrf/simple_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/simple_policy.ex @@ -222,7 +222,6 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicy do else {:reject, nil} -> {:reject, "[SimplePolicy]"} {:reject, _} = e -> e - _ -> {:reject, "[SimplePolicy]"} end end @@ -238,7 +237,6 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicy do else {:reject, nil} -> {:reject, "[SimplePolicy]"} {:reject, _} = e -> e - _ -> {:reject, "[SimplePolicy]"} end end @@ -251,7 +249,6 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicy do else {:reject, nil} -> {:reject, "[SimplePolicy]"} {:reject, _} = e -> e - _ -> {:reject, "[SimplePolicy]"} end end diff --git a/lib/pleroma/web/activity_pub/mrf/vocabulary_policy.ex b/lib/pleroma/web/activity_pub/mrf/vocabulary_policy.ex index d9deff35f..1c114558e 100644 --- a/lib/pleroma/web/activity_pub/mrf/vocabulary_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/vocabulary_policy.ex @@ -31,7 +31,6 @@ defmodule Pleroma.Web.ActivityPub.MRF.VocabularyPolicy do {:reject, _} = e -> e {:accepted, _} -> {:reject, "[VocabularyPolicy] #{message_type} not in accept list"} {:rejected, _} -> {:reject, "[VocabularyPolicy] #{message_type} in reject list"} - _ -> {:reject, "[VocabularyPolicy]"} end end diff --git a/lib/pleroma/web/admin_api/controllers/invite_controller.ex b/lib/pleroma/web/admin_api/controllers/invite_controller.ex index 7e3020f28..30dbc7e73 100644 --- a/lib/pleroma/web/admin_api/controllers/invite_controller.ex +++ b/lib/pleroma/web/admin_api/controllers/invite_controller.ex @@ -46,7 +46,6 @@ defmodule Pleroma.Web.AdminAPI.InviteController do render(conn, "show.json", invite: updated_invite) else nil -> {:error, :not_found} - error -> error end end diff --git a/lib/pleroma/web/common_api.ex b/lib/pleroma/web/common_api.ex index 34e480d73..7cefe3647 100644 --- a/lib/pleroma/web/common_api.ex +++ b/lib/pleroma/web/common_api.ex @@ -611,7 +611,6 @@ defmodule Pleroma.Web.CommonAPI do Utils.update_report_state(activity, state) else nil -> {:error, :not_found} - _ -> {:error, dgettext("errors", "Could not update state")} end end diff --git a/lib/pleroma/web/twitter_api/controllers/util_controller.ex b/lib/pleroma/web/twitter_api/controllers/util_controller.ex index 040fa3286..6805233df 100644 --- a/lib/pleroma/web/twitter_api/controllers/util_controller.ex +++ b/lib/pleroma/web/twitter_api/controllers/util_controller.ex @@ -207,9 +207,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do {:error, changeset} -> {_, {error, _}} = Enum.at(changeset.errors, 0) json(conn, %{error: "New password #{error}."}) - - _ -> - json(conn, %{error: "Unable to change password."}) end {:error, msg} ->