All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scalapb.descriptors.ReadsCompat.scala Maven / Gradle / Ivy

package scalapb.descriptors

import scala.language.higherKinds
import scala.collection.generic.CanBuildFrom

trait ReadsCompat {
  implicit def repeated[A, CC[_]](implicit
      reads: Reads[A],
      cbf: CanBuildFrom[Nothing, A, CC[A]]
  ): Reads[CC[A]] = Reads[CC[A]] {
    case PRepeated(value) => value.map(reads.read)(scala.collection.breakOut)
    case _                => throw new ReadsException("Expected PRepeated")
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy