Skip to content

Commit

Permalink
Use Scala 3-5-style Showable typeclass instead of Show
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Jun 12, 2024
1 parent c58ba32 commit e88c43d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/logging.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import language.experimental.pureFunctions

object Level:
given Ordering[Level] = Ordering[Int].on[Level](_.ordinal)
given Show[Level] = _.toString.tt.upper
given Level is Showable = _.toString.tt.upper

enum Level:
case Fine, Info, Warn, Fail
Expand All @@ -42,7 +42,7 @@ case class Entry[TextType]
Entry(realm, level, lambda(message), timestamp, envelopes)

object Envelope:
given [EnvelopeType](using Show[EnvelopeType]): Envelope[EnvelopeType] = _.show
given [EnvelopeType: Showable]: Envelope[EnvelopeType] = _.show

trait Envelope[-EnvelopeType]:
def envelope(value: EnvelopeType): Text
Expand Down

0 comments on commit e88c43d

Please sign in to comment.