Skip to content

Commit

Permalink
Fix compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Jun 15, 2024
1 parent 296b552 commit a39ff0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ trait Responder:
case class Content(media: MediaType, stream: LazyList[Bytes])

trait FallbackHandler:
given [ResponseType: Show](using encoder: CharEncoder): SimpleHandler[ResponseType] =
given [ResponseType: Showable](using encoder: CharEncoder): SimpleHandler[ResponseType] =
SimpleHandler(media"text/plain"(charset = encoder.encoding.name), value =>
HttpBody.Chunked(LazyList(value.show.bytes)))

Expand Down Expand Up @@ -149,7 +149,7 @@ case class Response[ContentType]
handler.process(content, status.code, (headers ++ cookieHeaders).map { case (k, v) => k.header -> v }, responder)

object Request:
given Show[Request] = request =>
given Request is Showable = request =>
val bodySample: Text =
try request.body.stream.readAs[Bytes].utf8 catch
case err: StreamError => t"[-/-]"
Expand Down

0 comments on commit a39ff0a

Please sign in to comment.