Skip to content

Commit 2ac9c83

Browse files
committed
Remove Jason
1 parent 7ac0257 commit 2ac9c83

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

lib/2015/day_12.ex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@ defmodule AdventOfCode.Y2015.Day12 do
1010
def input, do: InputReader.read_from_file(2015, 12)
1111

1212
def run(input \\ input()) do
13-
input = String.graphemes(input)
14-
1513
{run_1(input), run_2(input)}
1614
end
1715

1816
def run_1(input) do
1917
input
18+
|> String.graphemes()
2019
|> parse_json([])
2120
|> compute()
2221
end
2322

2423
def run_2(input) do
2524
input
26-
|> Jason.decode!()
25+
|> JSON.decode!()
2726
|> total()
2827
end
2928

lib/2022/day_13.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule AdventOfCode.Y2022.Day13 do
1616
|> String.split(~r{(\r\n\r\n|\r\r|\n\n)})
1717
|> Enum.map(fn pair ->
1818
[a, b] = Transformers.lines(pair)
19-
{Jason.decode!(a), Jason.decode!(b)}
19+
{JSON.decode!(a), JSON.decode!(b)}
2020
end)
2121
|> Enum.with_index(1)
2222
|> Enum.filter(fn {{x, y}, _} -> order(x, y) end)
@@ -28,7 +28,7 @@ defmodule AdventOfCode.Y2022.Day13 do
2828
input
2929
|> String.split(~r{(\r\n\r\n|\r\r|\n\n)})
3030
|> Enum.flat_map(&Transformers.lines(&1))
31-
|> Enum.map(&Jason.decode!/1)
31+
|> Enum.map(&JSON.decode!/1)
3232
|> Kernel.++([[[2]], [[6]]])
3333
|> Enum.sort_by(&Function.identity/1, &order/2)
3434
|> Enum.with_index(1)

mix.exs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ defmodule AdventOfCode.MixProject do
88
elixir: "~> 1.18",
99
start_permanent: Mix.env() == :prod,
1010
aliases: aliases(),
11-
deps: deps(),
12-
elixirc_options: [warnings_as_errors: true]
11+
deps: deps()
12+
# elixirc_options: [warnings_as_errors: true]
1313
]
1414
end
1515

@@ -26,7 +26,6 @@ defmodule AdventOfCode.MixProject do
2626
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
2727
{:floki, "~> 0.36"},
2828
{:httpoison, "~> 2.2"},
29-
{:jason, "~> 1.4"},
3029
{:libgraph, "~> 0.16"},
3130
{:aja, "~> 0.7"},
3231
{:topo, "~> 1.0"},

0 commit comments

Comments
 (0)