Skip to content

Commit

Permalink
use guard clause
Browse files Browse the repository at this point in the history
  • Loading branch information
altjohndev committed Jan 7, 2025
1 parent abe6745 commit c3a66b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/logger_json/formatter/redactor_encoder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule LoggerJSON.Formatter.RedactorEncoder do
def encode(binary, _redactors) when is_binary(binary), do: encode_binary(binary)

if @encoder_protocol == Jason.Encoder do
def encode(%Jason.Fragment{} = fragment, _redactors), do: fragment
def encode(fragment, _redactors) when is_struct(fragment, Jason.Fragment), do: fragment
end

def encode(%NaiveDateTime{} = naive_datetime, _redactors), do: naive_datetime
Expand Down

0 comments on commit c3a66b7

Please sign in to comment.