diff --git a/CHANGELOG.md b/CHANGELOG.md index f2e25915..7615d7b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- Fixed a compilation warning present with Elixir 1.17+ about "`4..1`" not + using a range step. + ## 1.0.3 - 2023-04-16 ### Fixed diff --git a/lib/mint/web_socket/frame.ex b/lib/mint/web_socket/frame.ex index ee2eaa06..047fe13c 100644 --- a/lib/mint/web_socket/frame.ex +++ b/lib/mint/web_socket/frame.ex @@ -183,7 +183,10 @@ defmodule Mint.WebSocket.Frame do # n=4 is the happy path # n=3..1 catches cases where the remaining byte_size/1 of the payload is shorter # than the mask - for n <- 4..1 do + # MINOR: We use a literal list instead of `4..1` to avoid compilation warnings on + # Elixir 1.17+ and instead of `4..1//-1` to maintain compatibility with older + # Elixir versions that do not support the range-step syntax. + for n <- [4, 3, 2, 1] do def apply_mask( <>, <> = mask,