fix elixir type warnings
This commit is contained in:
parent
24796f98d4
commit
d0b9513b41
12 changed files with 5 additions and 23 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ defmodule Aprsme.StreamingPacketsPubSub do
|
|||
|
||||
use GenServer
|
||||
|
||||
require Logger
|
||||
|
||||
@table_name :streaming_packets_subscribers
|
||||
|
||||
# Client API
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@
|
|||
</div>
|
||||
|
||||
<!-- Map showing station location -->
|
||||
<%= if @packet && @packet.lat && @packet.lon do %>
|
||||
<%= if @packet.lat && @packet.lon do %>
|
||||
<div class="bg-white shadow-xs sm:rounded-lg ring-1 ring-gray-950/5 dark:bg-gray-800/50 dark:shadow-none dark:ring-white/10 h-full">
|
||||
<% {symbol_table, symbol_code} = AprsmeWeb.AprsSymbol.extract_from_packet(@packet) %>
|
||||
<% symbol_html = AprsmeWeb.AprsSymbol.render_marker_html(symbol_table, symbol_code, @callsign, 32) %>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ defmodule AprsmeWeb.MapLive.PacketBatcher do
|
|||
|
||||
use GenServer
|
||||
|
||||
require Logger
|
||||
|
||||
@batch_size 10
|
||||
# milliseconds
|
||||
@batch_timeout 100
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -231,7 +231,6 @@ defmodule AprsmeWeb.WeatherLive.CallsignView do
|
|||
case value do
|
||||
"N/A" -> false
|
||||
"" -> false
|
||||
nil -> false
|
||||
_ -> true
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ defmodule AprsmeWeb.Plugs.RemoteIp do
|
|||
|
||||
import Plug.Conn
|
||||
|
||||
require Logger
|
||||
|
||||
@impl true
|
||||
def init(opts), do: opts
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue