Skip to content

Fix a warning in Elixir 1.16 #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2024
Merged

Conversation

ihumanable
Copy link
Owner

1..-2 has an implicit -1 step which is unused by String.slice but which generates a warning in Elixir 1.16

Elixir 1.16 suggests replacing this with 1..-2//1 but this syntax was introduced in 1.12 and would break any user of the library on older versions of Elixir.

This bugfix switches to String.slice/3 which is available on all supported versions.

`1..-2` has an implicit `-1` step which is unused by String.slice but which generates a warning in Elixir 1.16

Elixir 1.16 suggests replacing this with `1..-2//1` but this syntax was introduced in 1.12 and would break any user of the library on older versions of Elixir.

This bugfix switches to `String.slice/3` which is available on all supported versions.
@ihumanable ihumanable added the 🐞 Bug Something isn't working label May 3, 2024
@ihumanable
Copy link
Owner Author

Note that this issue was raised by #60 and #63

@ihumanable ihumanable merged commit 52704e7 into master May 3, 2024
33 checks passed
@ihumanable ihumanable deleted the bugfix/string-slice-warning-1.16 branch May 3, 2024 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant