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

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

The newest version!
package scalapb.descriptors

import collection.Factory

trait ReadsCompat {
  implicit def repeated[A, CC[_]](implicit
      reads: Reads[A],
      factory: Factory[A, CC[A]]
  ): Reads[CC[A]] = Reads[CC[A]] {
    case PRepeated(value) => value.iterator.map(reads.read).to(factory)
    case _                => throw new ReadsException("Expected PRepeated")
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy