From e8519258beef30d6d3d6d3b5510bc9fe141476cb Mon Sep 17 00:00:00 2001 From: Gregor Rayman Date: Tue, 10 Sep 2024 06:19:32 +0200 Subject: [PATCH] scalafmt --- .../src/main/scala/zio/schema/codec/JsonCodec.scala | 10 ++++++---- .../test/scala/zio/schema/codec/JsonCodecSpec.scala | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/zio-schema-json/shared/src/main/scala/zio/schema/codec/JsonCodec.scala b/zio-schema-json/shared/src/main/scala/zio/schema/codec/JsonCodec.scala index 72c84d988..b53716229 100644 --- a/zio-schema-json/shared/src/main/scala/zio/schema/codec/JsonCodec.scala +++ b/zio-schema-json/shared/src/main/scala/zio/schema/codec/JsonCodec.scala @@ -2,25 +2,27 @@ package zio.schema.codec import java.nio.CharBuffer import java.nio.charset.StandardCharsets + import scala.annotation.{ switch, tailrec } import scala.collection.immutable.ListMap + import zio.json.JsonCodec._ import zio.json.JsonDecoder.{ JsonError, UnsafeJson } import zio.json.ast.Json import zio.json.internal.{ Lexer, RecordingReader, RetractReader, StringMatrix, WithRecordingReader, Write } import zio.json.{ - JsonFieldDecoder, - JsonFieldEncoder, JsonCodec => ZJsonCodec, JsonDecoder => ZJsonDecoder, - JsonEncoder => ZJsonEncoder + JsonEncoder => ZJsonEncoder, + JsonFieldDecoder, + JsonFieldEncoder } import zio.prelude.NonEmptyMap import zio.schema._ import zio.schema.annotation._ import zio.schema.codec.DecodeError.ReadError import zio.stream.{ ZChannel, ZPipeline } -import zio.{ Cause, Chunk, ChunkBuilder, NonEmptyChunk, ZIO, ZNothing } +import zio.{ Cause, Chunk, ChunkBuilder, ZIO, ZNothing } object JsonCodec { diff --git a/zio-schema-json/shared/src/test/scala/zio/schema/codec/JsonCodecSpec.scala b/zio-schema-json/shared/src/test/scala/zio/schema/codec/JsonCodecSpec.scala index ec86e0c43..15a54e0a9 100644 --- a/zio-schema-json/shared/src/test/scala/zio/schema/codec/JsonCodecSpec.scala +++ b/zio-schema-json/shared/src/test/scala/zio/schema/codec/JsonCodecSpec.scala @@ -446,19 +446,19 @@ object JsonCodecSpec extends ZIOSpecDefault { }, test("Decodes a stream with multiple integers") { assertDecodesMore(Schema[Int], Chunk.fromIterable(1 to 5), charSequenceToByteChunk("1\n2\n3\n4\n5")) &> - assertDecodesMore(Schema[Int], Chunk.fromIterable(1 to 5), charSequenceToByteChunk("1 2 3 4 5")) &> - assertDecodesMore(Schema[Int], Chunk.fromIterable(1 to 5), charSequenceToByteChunk("1 2, 3;;; 4x5")) + assertDecodesMore(Schema[Int], Chunk.fromIterable(1 to 5), charSequenceToByteChunk("1 2 3 4 5")) &> + assertDecodesMore(Schema[Int], Chunk.fromIterable(1 to 5), charSequenceToByteChunk("1 2, 3;;; 4x5")) }, test("Decodes a stream with multiple booleans") { assertDecodesMore(Schema[Boolean], Chunk(true, true, false), charSequenceToByteChunk("true true false")) &> - assertDecodesMore(Schema[Boolean], Chunk(true, true, false), charSequenceToByteChunk("truetruefalse")) + assertDecodesMore(Schema[Boolean], Chunk(true, true, false), charSequenceToByteChunk("truetruefalse")) }, test("Encodes a stream with multiple strings") { assertEncodesMore(Schema[String], List("a", "b", "c"), charSequenceToByteChunk("\"a\"\n\"b\"\n\"c\"")) }, test("Decodes a stream with multiple strings") { assertDecodesMore(Schema[String], Chunk("a", "b", "c"), charSequenceToByteChunk("\"a\"\n\"b\"\n\"c\"")) &> - assertDecodesMore(Schema[String], Chunk("a", "b", "c"), charSequenceToByteChunk(""""a" "b""c"""")) + assertDecodesMore(Schema[String], Chunk("a", "b", "c"), charSequenceToByteChunk(""""a" "b""c"""")) }, test("Encodes a stream with multiple records") { assertEncodesMore(