Skip to content

Commit 3cf0974

Browse files
authored
Fix warnings on Elixir 1.19 (#150)
1 parent 64f9585 commit 3cf0974

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

lib/expo/mo.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ defmodule Expo.MO do
129129
| {:error, InvalidFileError.t() | UnsupportedVersionError.t() | File.posix()}
130130
def parse_file(path, options \\ []) when is_list(options) do
131131
with {:ok, contents} <- File.read(path),
132-
{:ok, po} <- Parser.parse(contents, Keyword.put_new(options, :file, path)) do
132+
{:ok, %Messages{} = po} <- Parser.parse(contents, Keyword.put_new(options, :file, path)) do
133133
{:ok, %Messages{po | file: path}}
134134
else
135135
{:error, %mod{} = error} when mod in [InvalidFileError, UnsupportedVersionError] ->

lib/expo/po/parser.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Expo.PO.Parser do
1414

1515
with {:ok, tokens} <- tokenize(content, opts),
1616
{:ok, po} <- parse_tokens(tokens),
17-
{:ok, po} <- check_for_duplicates(po) do
17+
{:ok, %Messages{} = po} <- check_for_duplicates(po) do
1818
{:ok, %Messages{po | file: Keyword.get(opts, :file)}}
1919
else
2020
{:error, %mod{} = error} when mod in [SyntaxError, DuplicateMessagesError] ->

mix.exs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ defmodule Expo.MixProject do
2424
else
2525
[]
2626
end,
27-
preferred_cli_env: [
28-
coveralls: :test,
29-
"coveralls.detail": :test,
30-
"coveralls.html": :test,
31-
"coveralls.json": :test,
32-
"coveralls.post": :test,
33-
"coveralls.xml": :test
34-
],
3527
package: package(),
3628
yecc_options: if(Mix.env() in [:dev, :test], do: [verbose: true])
3729
]
@@ -55,6 +47,19 @@ defmodule Expo.MixProject do
5547
]
5648
end
5749

50+
def cli do
51+
[
52+
preferred_envs: [
53+
coveralls: :test,
54+
"coveralls.detail": :test,
55+
"coveralls.html": :test,
56+
"coveralls.json": :test,
57+
"coveralls.post": :test,
58+
"coveralls.xml": :test
59+
]
60+
]
61+
end
62+
5863
defp docs do
5964
[
6065
source_url: @source_url,

0 commit comments

Comments
 (0)