Skip to content

Commit

Permalink
Fix warnings on Elixir 1.20+ (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenDE authored Dec 11, 2024
1 parent 57e0858 commit 106e298
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
matrix:
include:
- pair:
elixir: 1.6.x
otp: 21.x
elixir: 1.15.x
otp: 24.x
- pair:
elixir: 1.17.x
otp: 27.x
Expand Down
12 changes: 6 additions & 6 deletions lib/nimble_csv.ex
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ defmodule NimbleCSV do
|> Enum.with_index()
|> Enum.flat_map(fn {newline, i} ->
quote do
<<prefix::size(unquote(Macro.var(:"count#{i}", Elixir)))-binary, unquote(newline)>> ->
<<prefix::size(^unquote(Macro.var(:"count#{i}", Elixir)))-binary, unquote(newline)>> ->
prefix
end
end)
Expand All @@ -494,7 +494,7 @@ defmodule NimbleCSV do
clauses =
Enum.flat_map(@separator, fn sep ->
quote do
<<prefix::size(var!(pos))-binary, unquote(sep), @escape, rest::binary>> ->
<<prefix::size(^var!(pos))-binary, unquote(sep), @escape, rest::binary>> ->
escape(
rest,
"",
Expand Down Expand Up @@ -539,7 +539,7 @@ defmodule NimbleCSV do
defmacrop newlines_escape!(match) do
newlines_before =
quote do
<<prefix::size(offset)-binary, @escape, @escape, rest::binary>> ->
<<prefix::size(^offset)-binary, @escape, @escape, rest::binary>> ->
escape(
rest,
var!(entry) <> prefix <> <<@escape>>,
Expand All @@ -551,7 +551,7 @@ defmodule NimbleCSV do
end ++
Enum.flat_map(@separator, fn sep ->
quote do
<<prefix::size(offset)-binary, @escape, unquote(sep), rest::binary>> ->
<<prefix::size(^offset)-binary, @escape, unquote(sep), rest::binary>> ->
separator(
rest,
var!(row) ++ [var!(entry) <> prefix],
Expand All @@ -565,14 +565,14 @@ defmodule NimbleCSV do
newlines_clauses =
Enum.flat_map(@newlines, fn newline ->
quote do
<<prefix::size(offset)-binary, @escape, unquote(newline)>> ->
<<prefix::size(^offset)-binary, @escape, unquote(newline)>> ->
{var!(state), var!(row) ++ [var!(entry) <> prefix]}
end
end)

newlines_after =
quote do
<<prefix::size(offset)-binary, @escape>> ->
<<prefix::size(^offset)-binary, @escape>> ->
{var!(state), var!(row) ++ [var!(entry) <> prefix]}

_ ->
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule NimbleCSV.Mixfile do
[
app: :nimble_csv,
version: @version,
elixir: "~> 1.6",
elixir: "~> 1.15",
name: "NimbleCSV",
description: "A simple and fast CSV parsing and dumping library",
deps: deps(),
Expand Down

0 comments on commit 106e298

Please sign in to comment.