Skip to content

Commit e7f08aa

Browse files
author
changvvb
committed
fix test
1 parent 5b46d27 commit e7f08aa

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

pbconverts/src/main/scala-2.12/pbconverts/ScalableImplicits.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ trait ScalableImplicits {
99

1010
// java.lang.Iterable[M] => That[T]
1111
implicit def iterableScalable[That[_], S, P](implicit
12-
scalable: Scalable[T, M],
12+
scalable: Scalable[S, P],
1313
bf: CanBuildFrom[Nothing, S, That[S]]
14-
): Scalable[That[T], java.lang.Iterable[M]] =
14+
): Scalable[That[S], java.lang.Iterable[P]] =
1515
Scalable { proto
1616
proto.asScala.map(scalable.toScala).to[That]
1717
}
@@ -20,8 +20,8 @@ trait ScalableImplicits {
2020
Scalable { proto proto.asScala.to[That] }
2121

2222
// Repr[M] => That[T]
23-
implicit def iterableSelfScalable[That, Repr <: TraversableLike[M, Repr], S, P](implicit
24-
scalable: Scalable[T, M],
23+
implicit def iterableSelfScalable[That, Repr <: TraversableLike[P, Repr], S, P](implicit
24+
scalable: Scalable[S, P],
2525
bf: CanBuildFrom[Repr, S, That]
2626
): Scalable[That, Repr] = { proto
2727
proto.map(scalable.toScala)

pbconverts/src/main/scala/pbconverts/Protoable.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ object Protoable {
1414

1515
def apply[S <: Product, P]: Protoable[S, P] = macro ProtoScalableMacro.protosImpl[S, P]
1616

17-
def apply[S, P](f: S P): Protoable[S, P] =
18-
new Protoable[S, P] {
19-
override def toProto(entity: S): P = f(entity)
20-
}
17+
def apply[S, P](convert: S P): Protoable[S, P] = x => convert(x)
2118

2219
implicit val javaDoubleProtoable = Protoable[Double, java.lang.Double](_.toDouble)
2320
implicit val javaFloatProtoable = Protoable[Float, java.lang.Float](_.toFloat)

pbconverts/src/main/scala/pbconverts/Scalable.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ object Scalable extends ScalableImplicits {
1515

1616
def apply[S <: Product, P]: Scalable[S, P] = macro ProtoScalableMacro.scalasImpl[S, P]
1717

18-
def apply[S, P](convert: P S): Scalable[S, P] =
19-
new Scalable[S, P] {
20-
override def toScala(proto: P): S = convert(proto)
21-
}
18+
def apply[S, P](convert: P S): Scalable[S, P] = x => convert(x)
2219

2320
implicit val javaIntegerScalable = Scalable[Int, java.lang.Integer](_.toInt)
2421
implicit val javaLongScalable = Scalable[Long, java.lang.Long](_.toLong)

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 1.5.4
1+
sbt.version = 1.4.7

0 commit comments

Comments
 (0)