Skip to content

Commit

Permalink
use ByteString.utf8String (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning authored May 16, 2024
1 parent 88dd8f7 commit c223758
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ trait NinnySupport {
* unmarshaller for any `A` value
*/
implicit def fromByteStringUnmarshaller[A: FromJson]: Unmarshaller[ByteString, A] =
Unmarshaller(_ =>
bs => Future.fromTry(Json.parse(new String(bs.toArrayUnsafe(), StandardCharsets.UTF_8)).to[A])
)
Unmarshaller(_ => bs => Future.fromTry(Json.parse(bs.utf8String).to[A]))

/**
* HTTP entity => `Source[A, _]`
Expand Down

0 comments on commit c223758

Please sign in to comment.