Skip to content

Commit

Permalink
Merge pull request #172 from wkirschbaum/add-stringchars-protocol-check
Browse files Browse the repository at this point in the history
Check exclude_protocol_implementation for String.Chars defimpl
  • Loading branch information
kipcole9 authored Sep 17, 2024
2 parents d9c1817 + a4641f8 commit 13488b2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/money/protocol/string_chars.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
defimpl String.Chars, for: Money do
def to_string(v) do
Money.to_string!(v)
if !Money.exclude_protocol_implementation(String.Chars) do
defimpl String.Chars, for: Money do
def to_string(v) do
Money.to_string!(v)
end
end
end
end

0 comments on commit 13488b2

Please sign in to comment.