diff options
author | Johannes Rudolph <johannes.rudolph@gmail.com> | 2018-07-26 15:07:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-26 15:07:20 +0200 |
commit | a26f45ba61e39c7eb3c890a07ebb96edb7dbf987 (patch) | |
tree | 2d179701403a0aa29cb9fd3445aebf10059209bd | |
parent | 3054019aae26ec46f26239b3938af5e16f63111f (diff) | |
download | spray-json-a26f45ba61e39c7eb3c890a07ebb96edb7dbf987.tar.gz spray-json-a26f45ba61e39c7eb3c890a07ebb96edb7dbf987.tar.bz2 spray-json-a26f45ba61e39c7eb3c890a07ebb96edb7dbf987.zip |
Use classTag[T] instead of implicitly[ClassTag[T]]
-rw-r--r-- | src/main/boilerplate/spray/json/ProductFormatsInstances.scala.template | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/boilerplate/spray/json/ProductFormatsInstances.scala.template b/src/main/boilerplate/spray/json/ProductFormatsInstances.scala.template index 03d9492..401ac83 100644 --- a/src/main/boilerplate/spray/json/ProductFormatsInstances.scala.template +++ b/src/main/boilerplate/spray/json/ProductFormatsInstances.scala.template @@ -16,14 +16,13 @@ package spray.json -import scala.reflect.ClassTag +import scala.reflect.{ classTag, ClassTag } trait ProductFormatsInstances { self: ProductFormats with StandardFormats => [# // Case classes with 1 parameters def jsonFormat1[[#P1 :JF#], T <: Product :ClassTag](construct: ([#P1#]) => T): RootJsonFormat[T] = { - val c = implicitly[ClassTag[T]] - val Array([#p1#]) = extractFieldNames(c) + val Array([#p1#]) = extractFieldNames(classTag[T]) jsonFormat(construct, [#p1#]) } def jsonFormat[[#P1 :JF#], T <: Product](construct: ([#P1#]) => T, [#fieldName1: String#]): RootJsonFormat[T] = new RootJsonFormat[T]{ |