Skip to content

Commit

Permalink
Require Elixir 1.11+ (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
whatyouhide committed Apr 22, 2024
1 parent c5f3ed6 commit ffe1aab
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
fail-fast: false
matrix:
include:
- erlang: "26.0.2"
elixir: "1.15"
- erlang: "26.2"
elixir: "1.16"
lint: true
coverage: true
dialyzer: true
Expand All @@ -25,7 +25,7 @@ jobs:
elixir: "1.11"
dialyzer: true
- erlang: "21.3"
elixir: "1.10"
elixir: "1.11.4-otp-21"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MIX_ENV: test
Expand Down
7 changes: 0 additions & 7 deletions lib/mint/http.ex
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,6 @@ defmodule Mint.HTTP do

@opaque t() :: Mint.HTTP1.t() | Mint.HTTP2.t()

# TODO: Remove once we depend on Elixir 1.11+, which defines is_struct/2
if not macro_exported?(Kernel, :is_struct, 2) do
defguardp is_struct(struct, module)
when is_map(struct) and is_atom(module) and is_map_key(struct, :__struct__) and
:erlang.map_get(:__struct__, struct) == module
end

defguardp is_data_message(message)
when elem(message, 0) in [:ssl, :tcp] and tuple_size(message) == 3

Expand Down
11 changes: 1 addition & 10 deletions lib/mint/http2.ex
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,13 @@ defmodule Mint.HTTP2 do
conn = unquote(conn)

if conn.log do
Logger.log(normalize_logger_level(unquote(level)), unquote(message))
Logger.log(unquote(level), unquote(message))
else
:ok
end
end
end

# TODO: remove this once we depend on Elixir 1.11+.
if macro_exported?(Logger, :warning, 2) do
defp normalize_logger_level(:warning), do: :warning
else
defp normalize_logger_level(:warning), do: :warn
end

defp normalize_logger_level(level), do: level

## Types

@typedoc """
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 Mint.MixProject do
[
app: :mint,
version: @version,
elixir: "~> 1.10",
elixir: "~> 1.11",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
Expand Down

0 comments on commit ffe1aab

Please sign in to comment.