From ca08f0e19d2f5dd584c16691a6223f45f980fc0e Mon Sep 17 00:00:00 2001 From: Eshu Date: Fri, 13 Oct 2023 07:58:21 +0900 Subject: [PATCH] drop prelude --- zio-http/src/main/scala/zio/http/codec/TextChunkCodec.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zio-http/src/main/scala/zio/http/codec/TextChunkCodec.scala b/zio-http/src/main/scala/zio/http/codec/TextChunkCodec.scala index 1e73d0bd16..6233eedfae 100644 --- a/zio-http/src/main/scala/zio/http/codec/TextChunkCodec.scala +++ b/zio-http/src/main/scala/zio/http/codec/TextChunkCodec.scala @@ -2,7 +2,6 @@ package zio.http.codec import scala.annotation.tailrec -import zio.prelude._ import zio.{Chunk, ChunkBuilder, NonEmptyChunk} sealed trait TextChunkCodec[A, I] { @@ -34,7 +33,10 @@ object TextChunkCodec { case chunk if chunk.isEmpty => DecodeSuccess(None) case _ => InvalidCardinality(chunk.length, "one or none") } - override def encode(value: Option[I]): Chunk[String] = (value map codec.encode).toChunk + override def encode(value: Option[I]): Chunk[String] = value match { + case Some(item) => Chunk(codec.encode(item)) + case None => Chunk.empty + } } def one[I](codec: TextCodec[I]): TextChunkCodec[I, I] = new TextChunkCodec[I, I] { def parent: TextCodec[I] = codec