From 14fabe792d63d158b15b84dc664aeefb22f2b9db Mon Sep 17 00:00:00 2001 From: kenji yoshida <6b656e6a69@gmail.com> Date: Fri, 6 Oct 2023 01:07:45 +0900 Subject: [PATCH] add explicit type in customizations.md code (#1586) --- docs/src/main/markdown/customizations.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/main/markdown/customizations.md b/docs/src/main/markdown/customizations.md index fb727d747..0855ce7cb 100644 --- a/docs/src/main/markdown/customizations.md +++ b/docs/src/main/markdown/customizations.md @@ -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) } ``` @@ -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) } ``` @@ -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) }