Skip to content

Commit

Permalink
Relax formatter opts (#557)
Browse files Browse the repository at this point in the history
closes #499 

What changed?
============

`Bamboo.Formatter:format_email_address` allows for ignoring `_opts` 
(the second argument). But the it throws a type error after Elixir 1.9.1 
if no options are passed because the typespec requires a map with
`:type`. This commit relaxes that typespec constraint to make the 
`:type` optional.
  • Loading branch information
bradleygolden authored Oct 26, 2020
1 parent 8d447ec commit f923678
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bamboo/formatter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ defprotocol Bamboo.Formatter do
the address.
"""

@type opts :: %{type: :from | :to | :cc | :bcc}
@type opts :: %{optional(:type) => :from | :to | :cc | :bcc}

@spec format_email_address(any, opts) :: Bamboo.Email.address()
def format_email_address(data, opts)
Expand Down

0 comments on commit f923678

Please sign in to comment.