Skip to content

Commit

Permalink
refactor(elixir): remove deprecated HashSet:
Browse files Browse the repository at this point in the history
Related documentation: https://hexdocs.pm/elixir/1.12/HashSet.html

Fix these worning:

  warning: HashSet.new/0 is deprecated, use the MapSet module instead
    platform/elixir/mail_checker.ex:2

  warning: HashSet.member?/2 is deprecated, use the MapSet module instead
    platform/elixir/mail_checker.ex:11
  • Loading branch information
choznerol committed Nov 2, 2021
1 parent efd315c commit 7b91a01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions platform/elixir/mail_checker.ex

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions platform/elixir/mail_checker.tmpl.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule MailChecker do
@blacklist Enum.into([{{& listSTR }}], HashSet.new)
@blacklist Enum.into([{{& listSTR }}], MapSet.new)

def blacklist, do: @blacklist

Expand All @@ -8,7 +8,7 @@ defmodule MailChecker do
end

def in_blacklist?(email) do
Enum.any?(extract_domain_suffixes(email), fn domain -> HashSet.member?(blacklist, domain) end)
Enum.any?(extract_domain_suffixes(email), fn domain -> MapSet.member?(blacklist, domain) end)
end

def extract_domain_suffixes(email) do
Expand Down

0 comments on commit 7b91a01

Please sign in to comment.