diff --git a/build.sbt b/build.sbt index 18693d3..1d74f59 100644 --- a/build.sbt +++ b/build.sbt @@ -25,8 +25,8 @@ lazy val `teleproto` = project library.scalaCheck % Test, library.scalaCollectionCompat, "org.scala-lang" % "scala-reflect" % (ThisBuild / scalaVersion).value, - "io.scalaland" %% "chimney" % "1.0.0-M1", - "io.scalaland" %% "chimney-protobufs" % "1.0.0-M1" + "io.scalaland" %% "chimney" % "1.0.0", + "io.scalaland" %% "chimney-protobufs" % "1.0.0" ) ) diff --git a/src/main/scala/io/moia/protos/teleproto/Reader.scala b/src/main/scala/io/moia/protos/teleproto/Reader.scala index 5db3ecd..8ff6239 100644 --- a/src/main/scala/io/moia/protos/teleproto/Reader.scala +++ b/src/main/scala/io/moia/protos/teleproto/Reader.scala @@ -112,10 +112,11 @@ object Reader extends LowPriorityReads { def instance[P, M](f: P => PbResult[M]): Reader[P, M] = f(_) - def fromPartialTransformer[P, M](transformer: PartialTransformer[P, M]): Reader[P, M] = (model) => transformer.transform(model) match { - case Result.Value(value) => PbSuccess(value) - case Result.Errors(errors) => new PbFailure(errors.map(error => (error.path.asString, error.message.asString)).toSeq) - } + def fromPartialTransformer[P, M](transformer: PartialTransformer[P, M]): Reader[P, M] = (model) => + transformer.transform(model) match { + case Result.Value(value) => PbSuccess(value) + case Result.Errors(errors) => new PbFailure(errors.map(error => (error.path.asString, error.message.asString)).toSeq) + } /* Combinators */ diff --git a/src/main/scala/io/moia/protos/teleproto/ReaderImpl.scala b/src/main/scala/io/moia/protos/teleproto/ReaderImpl.scala index bc72f57..f46823f 100644 --- a/src/main/scala/io/moia/protos/teleproto/ReaderImpl.scala +++ b/src/main/scala/io/moia/protos/teleproto/ReaderImpl.scala @@ -83,7 +83,7 @@ class ReaderImpl(val c: blackbox.Context) extends FormatImpl { val result = compileInner(implicitValue) (result, compatibility) } else { - ask + ask // { // // Derive a chimney transformer and use it // def askTransformer = @@ -94,7 +94,8 @@ class ReaderImpl(val c: blackbox.Context) extends FormatImpl { // // writerFromTransformer // } - } else + } + else ask // use the available implicit }