Skip to content

Commit 402c92a

Browse files
committed
deps: Upgrade to Elixir 1.12+, fix warnings
1 parent 22777df commit 402c92a

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

lib/file_cache/temp.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ defmodule FileCache.Temp do
7676
end
7777

7878
defp parse_pid(pid_str) do
79-
{:ok, :erlang.list_to_pid('<#{pid_str}>')}
79+
{:ok, :erlang.list_to_pid(~c"<#{pid_str}>")}
8080
rescue
8181
ArgumentError ->
8282
{:error, :bad_pid}

lib/file_cache/utils.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule FileCache.Utils do
1616
def pid_to_string(pid) when is_pid(pid) do
1717
pid
1818
|> inspect()
19-
|> String.slice(5..-2)
19+
|> String.slice(5..-2//1)
2020
end
2121

2222
def rm_ignore_missing(path) when is_binary(path) or is_list(path) do

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule FileCache.MixProject do
55
[
66
app: :file_cache,
77
version: "0.1.0",
8-
elixir: "~> 1.10",
8+
elixir: "~> 1.12",
99
start_permanent: Mix.env() == :prod,
1010
deps: deps(),
1111
aliases: aliases(),

mix.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%{
22
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
3-
"credo": {:hex, :credo, "1.7.3", "05bb11eaf2f2b8db370ecaa6a6bda2ec49b2acd5e0418bc106b73b07128c0436", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "35ea675a094c934c22fb1dca3696f3c31f2728ae6ef5a53b5d648c11180a4535"},
4-
"file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"},
5-
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
6-
"nimble_options": {:hex, :nimble_options, "0.4.0", "c89babbab52221a24b8d1ff9e7d838be70f0d871be823165c94dd3418eea728f", [:mix], [], "hexpm", "e6701c1af326a11eea9634a3b1c62b475339ace9456c1a23ec3bc9a847bca02d"},
3+
"credo": {:hex, :credo, "1.7.12", "9e3c20463de4b5f3f23721527fcaf16722ec815e70ff6c60b86412c695d426c1", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8493d45c656c5427d9c729235b99d498bd133421f3e0a683e5c1b561471291e5"},
4+
"file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"},
5+
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
6+
"nimble_options": {:hex, :nimble_options, "0.5.2", "42703307b924880f8c08d97719da7472673391905f528259915782bb346e0a1b", [:mix], [], "hexpm", "4da7f904b915fd71db549bcdc25f8d56f378ef7ae07dc1d372cbe72ba950dce0"},
77
}

test/test_helper.exs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
defmodule FileCacheTest.Helpers do
2+
import ExUnit.Assertions
3+
24
def start_cache(opts \\ []) do
35
opts = Map.new(opts)
46

@@ -48,7 +50,7 @@ defmodule FileCacheTest.Helpers do
4850
def random_string do
4951
:rand.uniform()
5052
|> to_string()
51-
|> String.slice(2..-1)
53+
|> String.slice(2..-1//1)
5254
|> Base.encode64()
5355
end
5456

@@ -187,7 +189,7 @@ defmodule FileCacheTest.Helpers do
187189
|> String.split("\n", trim: true)
188190
|> Enum.map(fn entry ->
189191
[_timestamp, level, message] = String.split(entry, ~r/ +/, parts: 3)
190-
{String.to_atom(String.slice(level, 1..-2)), message}
192+
{String.to_atom(String.slice(level, 1..-2//1)), message}
191193
end)
192194

193195
case Keyword.get(opts, :order, true) do
@@ -205,14 +207,12 @@ defmodule FileCacheTest.Helpers do
205207
end
206208

207209
def assert_kill(pid, reason \\ :kill) do
208-
import ExUnit.Assertions
209-
210210
Process.flag(:trap_exit, true)
211211
Process.exit(pid, reason)
212212

213213
case reason do
214-
:kill -> ExUnit.Assertions.assert_receive({:EXIT, ^pid, :killed})
215-
other -> ExUnit.Assertions.assert_receive({:EXIT, ^pid, ^other})
214+
:kill -> assert_receive({:EXIT, ^pid, :killed})
215+
other -> assert_receive({:EXIT, ^pid, ^other})
216216
end
217217

218218
Process.flag(:trap_exit, false)

0 commit comments

Comments
 (0)