Skip to content

Commit

Permalink
Instead of different function clauses use one with multiple when guards.
Browse files Browse the repository at this point in the history
Co-authored-by: Felipe Vieira <[email protected]>
  • Loading branch information
Ivor and nvieirafelipe authored Oct 25, 2024
1 parent 941a6d1 commit 02bd65a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/meta_logger/slicer/utf8_impl.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ defmodule MetaLogger.Slicer.Utf8Impl do
"""
@impl MetaLogger.Slicer
@spec slice(binary(), MetaLogger.Slicer.max_entry_length()) :: [String.t()]
def slice(log_entry, :infinity), do: [log_entry]

def slice(entry, max_entry_length) when byte_size(entry) <= max_entry_length,
def slice(entry, max_entry_length)
when max_enty_length == :infinity
when byte_size(entry) <= max_entry_length,
do: [entry]

def slice(entry, max_entry_length) do
Expand Down

0 comments on commit 02bd65a

Please sign in to comment.