chore: move when clause into pattern

This commit is contained in:
2024-09-01 21:41:00 +02:00
parent 7ff96fabe1
commit b2f8ddfff3
2 changed files with 25 additions and 8 deletions

View File

@@ -43,11 +43,11 @@ defmodule Swoosh.Adapters.Mailinator do
alias Swoosh.Email
alias Swoosh.Mailer
def deliver(%Email{html_body: html, text_body: text} = email, _) when is_nil(html) do
def deliver(%Email{html_body: nil, text_body: _} = email, _) do
email |> delegate
end
def deliver(%Email{html_body: html, text_body: text} = email, _) when is_nil(text) do
def deliver(%Email{html_body: _, text_body: nil} = email, _) do
email |> delegate
end