From 93290b414e16ed66d97a2c5756c71a5e48d366a4 Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Mon, 25 Dec 2023 10:06:09 +0900 Subject: [PATCH] use new syntax. prepare Scala 3.4 --- .../src/main/scala/scalapb_argonaut/AnyFormat.scala | 2 +- .../src/main/scala/scalapb_argonaut/JsonFormat.scala | 8 ++++---- .../src/main/scala/scalapb_argonaut/StructFormat.scala | 2 +- .../test/scala/scalapb_argonaut/RepeatableTestGen.scala | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/shared/src/main/scala/scalapb_argonaut/AnyFormat.scala b/core/shared/src/main/scala/scalapb_argonaut/AnyFormat.scala index 7ca2e86..eda5171 100644 --- a/core/shared/src/main/scala/scalapb_argonaut/AnyFormat.scala +++ b/core/shared/src/main/scala/scalapb_argonaut/AnyFormat.scala @@ -22,7 +22,7 @@ object AnyFormat { // ... and add the @type marker to the resulting JSON printer.toJson(message).obj match { case Some(fields) => - Json.obj(("@type" -> Json.jString(any.typeUrl)) :: fields.toList: _*) + Json.obj((("@type" -> Json.jString(any.typeUrl)) :: fields.toList) *) case value => // Safety net, this shouldn't happen throw new IllegalStateException( diff --git a/core/shared/src/main/scala/scalapb_argonaut/JsonFormat.scala b/core/shared/src/main/scala/scalapb_argonaut/JsonFormat.scala index 28d9cef..8398268 100644 --- a/core/shared/src/main/scala/scalapb_argonaut/JsonFormat.scala +++ b/core/shared/src/main/scala/scalapb_argonaut/JsonFormat.scala @@ -159,7 +159,7 @@ class Printer private (config: Printer.PrinterConfig) { ) } key -> value - }.toList: _*) + }.toList *) ) } else { b += JField(name, Json.jArray(xs.iterator.map(toJson).toList)) @@ -187,7 +187,7 @@ class Printer private (config: Printer.PrinterConfig) { b += JField( name, Json.array( - xs.map(serializeSingleValue(fd, _, config.isFormattingLongAsNumber)): _* + xs.map(serializeSingleValue(fd, _, config.isFormattingLongAsNumber)) * ) ) } @@ -221,7 +221,7 @@ class Printer private (config: Printer.PrinterConfig) { serializeNonMessageField(f, name, m.getField(f), b) } } - Json.obj(b.result(): _*) + Json.obj(b.result() *) } } @@ -638,7 +638,7 @@ object JsonFormat { StructFormat.structParser ) .registerWriter[com.google.protobuf.struct.ListValue]( - x => Json.array(StructFormat.listValueWriter(x): _*), + x => Json.array(StructFormat.listValueWriter(x) *), StructFormat.listValueParser ) .registerMessageFormatter[com.google.protobuf.any.Any](AnyFormat.anyWriter, AnyFormat.anyParser) diff --git a/core/shared/src/main/scala/scalapb_argonaut/StructFormat.scala b/core/shared/src/main/scala/scalapb_argonaut/StructFormat.scala index 050c3d7..33e8fc2 100644 --- a/core/shared/src/main/scala/scalapb_argonaut/StructFormat.scala +++ b/core/shared/src/main/scala/scalapb_argonaut/StructFormat.scala @@ -42,7 +42,7 @@ object StructFormat { def structWriter(v: struct.Struct): Json = Json.obj(v.fields.iterator.map { case (x, y) => x -> structValueWriter(y) - }.toList: _*) + }.toList *) def listValueParser(v: Json.JsonArray): struct.ListValue = { com.google.protobuf.struct.ListValue(v.map(structValueParser)) diff --git a/core/shared/src/test/scala/scalapb_argonaut/RepeatableTestGen.scala b/core/shared/src/test/scala/scalapb_argonaut/RepeatableTestGen.scala index ba2e0d1..e033572 100644 --- a/core/shared/src/test/scala/scalapb_argonaut/RepeatableTestGen.scala +++ b/core/shared/src/test/scala/scalapb_argonaut/RepeatableTestGen.scala @@ -28,7 +28,7 @@ class RepeatableTestGen(unknown: Gen[UnknownFieldSet]) { Gen.from1(Nested.of) private[this] implicit val enumGen: Gen[RepeatablesTest.Enum] = - Gen.elements(RepeatablesTest.Enum.values.head, RepeatablesTest.Enum.values.tail: _*) + Gen.elements(RepeatablesTest.Enum.values.head, RepeatablesTest.Enum.values.tail *) implicit val repGen: Gen[RepeatablesTest] = Gen.from6(RepeatablesTest.of)