Skip to content

Commit

Permalink
add explicit type in customizations.md code (#1586)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k authored Oct 5, 2023
1 parent 9089c7a commit 14fabe7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/src/main/markdown/customizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ package mydomain
case class Seconds(v: Int) extends AnyVal

object Seconds {
implicit val typeMapper = TypeMapper(Seconds.apply)(_.v)
implicit val typeMapper: TypeMapper[Int, Seconds] = TypeMapper(Seconds.apply)(_.v)
}
```

Expand Down Expand Up @@ -548,7 +548,7 @@ goes into the `a.b.c` package, you can define the type mapper like this:
package a.b

package object c {
implicit val segmentType =
implicit val segmentType: TypeMapper[SegmentType, String] =
TypeMapper[SegmentType, String](_.name)(SegmentType.fromName(_).get)
}
```
Expand Down Expand Up @@ -584,7 +584,7 @@ import mytypes.duration.Duration
case class MyDurationClass(seconds: Int)

object MyDurationClass {
implicit val tm = TypeMapper[Duration, MyDurationClass] {
implicit val tm: TypeMapper[Duration, MyDurationClass] = TypeMapper[Duration, MyDurationClass] {
d: Duration => MyDurationClass(d.seconds) } {
m: MyDurationClass => Duration(m.seconds)
}
Expand Down

0 comments on commit 14fabe7

Please sign in to comment.