Skip to content
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

Change usages of single quotes to sigil ~c #70

Conversation

tomekowal
Copy link
Contributor

When using
elixir 1.17.0-rc.0-otp-27
and erlang 27.0

compilation produces warnings:

Compiling 23 files (.ex)
     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 239 │       |> Keyword.get(:password, '')
     │                                 ~
     │
     └─ lib/x509/private_key.ex:239:33

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 310 │     {'DES-EDE3-CBC', :crypto.strong_rand_bytes(8)}
     │      ~
     │
     └─ lib/x509/private_key.ex:310:6

    warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
    │
 30 │     '#{date}#{time}Z'
    │     ~
    │
    └─ lib/x509/date_time.ex:30:5

    warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
    │
 43 │     '#{date}#{time}Z'
    │     ~
    │
    └─ lib/x509/date_time.ex:43:5

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 408 │                      ' \'()+,-./:=?'
     │                      ~
     │
     └─ lib/x509/rdn_sequence.ex:408:22

This is because https://github.com/elixir-lang/elixir/releases/tag/v1.17.0-rc.0

[Kernel] Single-quote charlists are deprecated, use ~c instead

I checked that the sigil ~c existed in Elixir 1.5 https://hexdocs.pm/elixir/1.5.0-rc.0/Kernel.html that is the minimal supported Elixir according to mix.exs in the repository.

The change fixes the issue in newest Elixir while being fully backward compatible.

@voltone
Copy link
Owner

voltone commented Jun 25, 2024

Superseded by #73 and #74

@voltone voltone closed this Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants