Skip to content

Commit

Permalink
Bump chimney to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
urmaul committed May 31, 2024
1 parent a8d1408 commit 24b9beb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)

Expand Down
9 changes: 5 additions & 4 deletions src/main/scala/io/moia/protos/teleproto/Reader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
5 changes: 3 additions & 2 deletions src/main/scala/io/moia/protos/teleproto/ReaderImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -94,7 +94,8 @@ class ReaderImpl(val c: blackbox.Context) extends FormatImpl {
//
// writerFromTransformer
// }
} else
}
else
ask // use the available implicit
}

Expand Down

0 comments on commit 24b9beb

Please sign in to comment.