diff --git a/.tool-versions b/.tool-versions index ff3098f..44cbbf7 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ erlang 28.5 -elixir 1.19.5-otp-28 +elixir 1.20.0-rc.6-otp-28 #elixir 1.20.0-rc.1-otp-28 diff --git a/lib/aprsme/encoding.ex b/lib/aprsme/encoding.ex index d6cbaa0..7c4896e 100644 --- a/lib/aprsme/encoding.ex +++ b/lib/aprsme/encoding.ex @@ -220,7 +220,7 @@ defmodule Aprsme.Encoding do @spec valid_utf8_continuation?(binary(), non_neg_integer()) :: boolean() defp valid_utf8_continuation?(binary, pos) do - <<_::binary-size(pos), _char::utf8, _::binary>> = binary + <<_::binary-size(^pos), _char::utf8, _::binary>> = binary true rescue _ -> false diff --git a/lib/aprsme/regex_cache.ex b/lib/aprsme/regex_cache.ex index 2e1bfcc..54fe688 100644 --- a/lib/aprsme/regex_cache.ex +++ b/lib/aprsme/regex_cache.ex @@ -10,8 +10,6 @@ defmodule Aprsme.RegexCache do use GenServer - require Logger - @table_name :regex_cache @max_cache_size 1000 # When the cache is full, drop this fraction of least-recently-used entries. diff --git a/lib/aprsme/spatial_pubsub.ex b/lib/aprsme/spatial_pubsub.ex index 223abe3..d6f9274 100644 --- a/lib/aprsme/spatial_pubsub.ex +++ b/lib/aprsme/spatial_pubsub.ex @@ -5,8 +5,6 @@ defmodule Aprsme.SpatialPubSub do """ use GenServer - require Logger - # Grid size in degrees for spatial indexing @grid_size 1.0 # Maximum number of concurrent clients diff --git a/lib/aprsme/streaming_packets_pubsub.ex b/lib/aprsme/streaming_packets_pubsub.ex index 9913c49..6e66b58 100644 --- a/lib/aprsme/streaming_packets_pubsub.ex +++ b/lib/aprsme/streaming_packets_pubsub.ex @@ -8,8 +8,6 @@ defmodule Aprsme.StreamingPacketsPubSub do use GenServer - require Logger - @table_name :streaming_packets_subscribers # Client API diff --git a/lib/aprsme_web/controllers/api/v1/fallback_controller.ex b/lib/aprsme_web/controllers/api/v1/fallback_controller.ex index af014a6..269c2d6 100644 --- a/lib/aprsme_web/controllers/api/v1/fallback_controller.ex +++ b/lib/aprsme_web/controllers/api/v1/fallback_controller.ex @@ -73,7 +73,6 @@ defmodule AprsmeWeb.Api.V1.FallbackController do |> render(:"500") end - defp format_error_message(:not_found), do: gettext("Resource not found") defp format_error_message(:unauthorized), do: gettext("Unauthorized access") defp format_error_message(:forbidden), do: gettext("Access forbidden") defp format_error_message(:bad_request), do: gettext("Bad request") diff --git a/lib/aprsme_web/live/info_live/show.html.heex b/lib/aprsme_web/live/info_live/show.html.heex index 865ae74..2bf0085 100644 --- a/lib/aprsme_web/live/info_live/show.html.heex +++ b/lib/aprsme_web/live/info_live/show.html.heex @@ -187,7 +187,7 @@ - <%= if @packet && @packet.lat && @packet.lon do %> + <%= if @packet.lat && @packet.lon do %>
<% {symbol_table, symbol_code} = AprsmeWeb.AprsSymbol.extract_from_packet(@packet) %> <% symbol_html = AprsmeWeb.AprsSymbol.render_marker_html(symbol_table, symbol_code, @callsign, 32) %> diff --git a/lib/aprsme_web/live/map_live/packet_batcher.ex b/lib/aprsme_web/live/map_live/packet_batcher.ex index f8aa71b..7ee45fa 100644 --- a/lib/aprsme_web/live/map_live/packet_batcher.ex +++ b/lib/aprsme_web/live/map_live/packet_batcher.ex @@ -6,8 +6,6 @@ defmodule AprsmeWeb.MapLive.PacketBatcher do use GenServer - require Logger - @batch_size 10 # milliseconds @batch_timeout 100 diff --git a/lib/aprsme_web/live/shared/param_utils.ex b/lib/aprsme_web/live/shared/param_utils.ex index e9946c2..45ac3ea 100644 --- a/lib/aprsme_web/live/shared/param_utils.ex +++ b/lib/aprsme_web/live/shared/param_utils.ex @@ -98,12 +98,8 @@ defmodule AprsmeWeb.Live.Shared.ParamUtils do end end - def safe_parse_coordinate(value, default, min, max) when is_number(value) do - if finite_number?(value) do - clamp_coordinate(value, min, max) - else - default - end + def safe_parse_coordinate(value, _default, min, max) when is_number(value) do + clamp_coordinate(value, min, max) end def safe_parse_coordinate(_, default, _, _), do: default diff --git a/lib/aprsme_web/live/weather_live/callsign_view.ex b/lib/aprsme_web/live/weather_live/callsign_view.ex index 85941c2..a468e89 100644 --- a/lib/aprsme_web/live/weather_live/callsign_view.ex +++ b/lib/aprsme_web/live/weather_live/callsign_view.ex @@ -231,7 +231,6 @@ defmodule AprsmeWeb.WeatherLive.CallsignView do case value do "N/A" -> false "" -> false - nil -> false _ -> true end end diff --git a/lib/aprsme_web/plugs/health_check.ex b/lib/aprsme_web/plugs/health_check.ex index 791438d..a1b24a9 100644 --- a/lib/aprsme_web/plugs/health_check.ex +++ b/lib/aprsme_web/plugs/health_check.ex @@ -8,8 +8,6 @@ defmodule AprsmeWeb.Plugs.HealthCheck do alias Ecto.Adapters.SQL - require Logger - def init(opts), do: opts def call(%{request_path: "/health"} = conn, opts) do diff --git a/lib/aprsme_web/plugs/remote_ip.ex b/lib/aprsme_web/plugs/remote_ip.ex index 60a8ee2..41cada2 100644 --- a/lib/aprsme_web/plugs/remote_ip.ex +++ b/lib/aprsme_web/plugs/remote_ip.ex @@ -11,8 +11,6 @@ defmodule AprsmeWeb.Plugs.RemoteIp do import Plug.Conn - require Logger - @impl true def init(opts), do: opts