Skip to content

Commit

Permalink
use new syntax. prepare Scala 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Dec 25, 2023
1 parent 6c0d98a commit 93290b4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions core/shared/src/main/scala/scalapb_argonaut/JsonFormat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)) *
)
)
}
Expand Down Expand Up @@ -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() *)
}
}

Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 93290b4

Please sign in to comment.