Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use new syntax. prepare Scala 3.4 #389

Merged
merged 1 commit into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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