Skip to content

Commit

Permalink
Reformat with scalafmt 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
scala-steward committed Aug 27, 2021
1 parent 83ac367 commit 728f990
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions optics/src/main/scala/io/circe/optics/JsonPath.scala
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,14 @@ object UnsafeOptics {
*/
final val keyMissingNone: Option[None.type] = Some(None)
def optionParse[A](implicit decode: Decoder[A], encode: Encoder[A]): Prism[Option[Json], Option[A]] =
Prism[Option[Json], Option[A]](
{
case Some(json) =>
decode.decodeJson(json) match {
case Right(a) => Some(Some(a))
case Left(_) => None
}
case None => keyMissingNone
}
)(_.map(encode(_)))
Prism[Option[Json], Option[A]] {
case Some(json) =>
decode.decodeJson(json) match {
case Right(a) => Some(Some(a))
case Left(_) => None
}
case None => keyMissingNone
}(_.map(encode(_)))

/**
* Select if a value matches a predicate
Expand Down

0 comments on commit 728f990

Please sign in to comment.