Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
lint: true
coverage: true
os: ubuntu-latest
- erlang: "23"
elixir: "1.12"
os: ubuntu-20.04
- erlang: "24"
elixir: "1.15"
os: ubuntu-22.04

env:
MIX_ENV: test
Expand Down
2 changes: 1 addition & 1 deletion lib/hpax/huffman.ex
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ defmodule HPAX.Huffman do
# Use binary syntax for single match context optimization.
def decode(<<padding::bitstring>>) when bit_size(padding) in 1..7 do
padding_size = bit_size(padding)
<<padding::size(padding_size)>> = padding
<<padding::size(^padding_size)>> = padding

if take_significant_bits(unquote(eos_bits), unquote(eos_bit_count), padding_size) == padding do
<<>>
Expand Down
4 changes: 2 additions & 2 deletions lib/hpax/types.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ defmodule HPAX.Types do

@spec decode_integer(bitstring, 1..8) :: {:ok, non_neg_integer(), binary()} | :error
def decode_integer(bitstring, prefix) when is_bitstring(bitstring) and prefix in 1..8 do
with <<value::size(prefix), rest::binary>> <- bitstring do
with <<value::size(^prefix), rest::binary>> <- bitstring do
if value < power_of_two(prefix) - 1 do
{:ok, value, rest}
else
Expand All @@ -74,7 +74,7 @@ defmodule HPAX.Types do
def decode_binary(binary) when is_binary(binary) do
with <<huffman_bit::1, rest::bitstring>> <- binary,
{:ok, length, rest} <- decode_integer(rest, 7),
<<contents::binary-size(length), rest::binary>> <- rest do
<<contents::binary-size(^length), rest::binary>> <- rest do
contents =
case huffman_bit do
0 -> contents
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 HPAX.MixProject do
[
app: :hpax,
version: @version,
elixir: "~> 1.12",
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
deps: deps(),

Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
"makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"},
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
"stream_data": {:hex, :stream_data, "1.1.2", "05499eaec0443349ff877aaabc6e194e82bda6799b9ce6aaa1aadac15a9fdb4d", [:mix], [], "hexpm", "129558d2c77cbc1eb2f4747acbbea79e181a5da51108457000020a906813a1a9"},
"stream_data": {:hex, :stream_data, "1.2.0", "58dd3f9e88afe27dc38bef26fce0c84a9e7a96772b2925c7b32cd2435697a52b", [:mix], [], "hexpm", "eb5c546ee3466920314643edf68943a5b14b32d1da9fe01698dc92b73f89a9ed"},
}