Skip to content

Commit 0c6fea9

Browse files
committed
Fix compilation warnings introduced in Elixir v1.19
1 parent a212279 commit 0c6fea9

File tree

18 files changed

+15
-38
lines changed

18 files changed

+15
-38
lines changed

packages/sync-service/lib/electric.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ defmodule Electric do
115115
use a provided value as stack id, but nothing else.
116116
"""
117117

118-
require Logger
119-
120118
@doc false
121119
def connection_opts_schema do
122120
@connection_opts

packages/sync-service/lib/electric/plug/delete_shape_plug.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ defmodule Electric.Plug.DeleteShapePlug do
33

44
alias Electric.Shapes.Api
55

6-
require Logger
7-
86
plug :fetch_query_params
97
plug :put_resp_content_type, "application/json"
108

packages/sync-service/lib/electric/plug/health_check_plug.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
defmodule Electric.Plug.HealthCheckPlug do
2+
use Plug.Builder
3+
24
alias Plug.Conn
35
alias Electric.StatusMonitor
4-
require Logger
5-
use Plug.Builder
66

77
plug :fetch_query_params
88
plug :check_service_status

packages/sync-service/lib/electric/plug/options_shape_plug.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
defmodule Electric.Plug.OptionsShapePlug do
22
use Plug.Builder
33

4-
require Logger
5-
64
plug :call_options_api
75

86
defp call_options_api(%Plug.Conn{} = conn, _) do

packages/sync-service/lib/electric/plug/trace_context_plug.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ defmodule Electric.Plug.TraceContextPlug do
22
@moduledoc """
33
A plug that extracts trace context from incoming HTTP headers and sets it as the parent span.
44
"""
5-
@behaviour Plug
65

7-
require Logger
6+
@behaviour Plug
87

98
def init(opts), do: opts
109

packages/sync-service/lib/electric/replication/changes.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ defmodule Electric.Replication.Changes do
1313
alias Electric.Replication.Changes
1414
alias Electric.Replication.LogOffset
1515

16-
require Logger
17-
1816
@type db_identifier() :: String.t()
1917
@type xid() :: non_neg_integer()
2018
@type relation_name() :: {schema :: db_identifier(), table :: db_identifier()}

packages/sync-service/lib/electric/replication/persistent_replication_state.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
defmodule Electric.Replication.PersistentReplicationState do
22
alias Electric.PersistentKV
33
alias Electric.Replication.Changes
4-
require Logger
54

65
@type opts() :: [
76
stack_id: String.t(),

packages/sync-service/lib/electric/replication/shape_log_collector/flush_tracker.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
defmodule Electric.Replication.ShapeLogCollector.FlushTracker do
2-
require Electric.Replication.LogOffset
32
alias Electric.Replication.LogOffset
43
alias Electric.Replication.Changes.Transaction
54

packages/sync-service/lib/electric/shape_cache/pure_file_storage/key_index.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ defmodule Electric.ShapeCache.PureFileStorage.KeyIndex do
3030
with <<total_size::32, _label::8, tx_offset::64, op_offset::64, op_type::8,
3131
log_file_entry_start_pos::64,
3232
json_size::64>> <- IO.binread(file, @key_index_full_size),
33-
<<key::binary-size(total_size - @key_index_entry_size)>> <-
33+
<<key::binary-size(^total_size - @key_index_entry_size)>> <-
3434
IO.binread(file, total_size - @key_index_entry_size) do
3535
{{key, LogOffset.new(tx_offset, op_offset), op_type, log_file_entry_start_pos,
3636
json_size}, {file, pos + total_size + 4}}
@@ -68,7 +68,7 @@ defmodule Electric.ShapeCache.PureFileStorage.KeyIndex do
6868
Stream.unfold(search_start_pos, fn position ->
6969
with <<total_size::32, _::8, _::64, _::64, _::8, line_start_pos::64, json_size::64>> <-
7070
IO.binread(file, @key_index_full_size),
71-
<<_::binary-size(total_size - @key_index_full_size)>> <-
71+
<<_::binary-size(^total_size - @key_index_full_size)>> <-
7272
IO.binread(file, total_size - @key_index_full_size) do
7373
{
7474
LogFile.expected_position(
@@ -100,7 +100,7 @@ defmodule Electric.ShapeCache.PureFileStorage.KeyIndex do
100100
with <<total_size::32, label::8, tx_offset::64, op_offset::64, op_type::8,
101101
log_file_entry_start_pos::64,
102102
json_size::64>> <- IO.binread(file, @key_index_full_size),
103-
<<key::binary-size(total_size - @key_index_entry_size)>> <-
103+
<<key::binary-size(^total_size - @key_index_entry_size)>> <-
104104
IO.binread(file, total_size - @key_index_entry_size) do
105105
{[
106106
{{total_size - @key_index_entry_size, key}, label,

packages/sync-service/lib/electric/shape_cache/pure_file_storage/log_file.ex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ defmodule Electric.ShapeCache.PureFileStorage.LogFile do
8484

8585
defp read_line(file) do
8686
with <<tx_offset::64, op_offset::64, key_size::32>> <- IO.binread(file, 20),
87-
<<key::binary-size(key_size)>> <- IO.binread(file, key_size),
87+
<<key::binary-size(^key_size)>> <- IO.binread(file, key_size),
8888
<<op_type::8, processed_flag::8, json_size::64>> <- IO.binread(file, 10),
89-
<<json::binary-size(json_size)>> <- IO.binread(file, json_size) do
89+
<<json::binary-size(^json_size)>> <- IO.binread(file, json_size) do
9090
{LogOffset.new(tx_offset, op_offset), key_size, key, op_type, processed_flag, json_size,
9191
json}
9292
end
@@ -173,9 +173,9 @@ defmodule Electric.ShapeCache.PureFileStorage.LogFile do
173173

174174
{file, position} ->
175175
with <<tx_offset::64, op_offset::64, key_size::32>> <- IO.binread(file, 20),
176-
<<key::binary-size(key_size)>> <- IO.binread(file, key_size),
176+
<<key::binary-size(^key_size)>> <- IO.binread(file, key_size),
177177
<<op_type::8, flag::8, json_size::64>> <- IO.binread(file, 10),
178-
<<json::binary-size(json_size)>> <- IO.binread(file, json_size) do
178+
<<json::binary-size(^json_size)>> <- IO.binread(file, json_size) do
179179
entry =
180180
{LogOffset.new(tx_offset, op_offset), key_size, key, op_type, flag, json_size, json}
181181

@@ -323,9 +323,9 @@ defmodule Electric.ShapeCache.PureFileStorage.LogFile do
323323

324324
Stream.unfold(search_start_pos, fn position ->
325325
with <<tx_offset::64, op_offset::64, key_size::32>> <- IO.binread(file, 20),
326-
<<_::binary-size(key_size)>> <- IO.binread(file, key_size),
326+
<<_::binary-size(^key_size)>> <- IO.binread(file, key_size),
327327
<<_::8, _::8, json_size::64>> <- IO.binread(file, 10),
328-
<<_::binary-size(json_size)>> <- IO.binread(file, json_size) do
328+
<<_::binary-size(^json_size)>> <- IO.binread(file, json_size) do
329329
read = 20 + key_size + json_size + 10
330330
{{LogOffset.new(tx_offset, op_offset), position + read, read}, position + read}
331331
else

0 commit comments

Comments
 (0)