Skip to content

Commit

Permalink
Add explicit Buf type parameters for Reader and Writer
Browse files Browse the repository at this point in the history
  • Loading branch information
travisbrown-stripe committed Sep 13, 2018
1 parent 44eb70e commit c8344c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions iteratee/src/main/scala/io/finch/iteratee/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package object iteratee extends IterateeInstances {

import syntax._

private[finch] def enumeratorFromReader(reader: Reader): Enumerator[Future, Buf] = {
def rec(reader: Reader): Enumerator[Future, Buf] = {
private[finch] def enumeratorFromReader(reader: Reader[Buf]): Enumerator[Future, Buf] = {
def rec(reader: Reader[Buf]): Enumerator[Future, Buf] = {
reader.read(Int.MaxValue).intoEnumerator.flatMap {
case None => empty[Buf]
case Some(buf) => enumOne(buf).append(rec(reader))
Expand Down Expand Up @@ -80,7 +80,7 @@ trait LowPriorityInstances extends FutureModule {
withCustomIteratee(writer => foreachM((buf: Buf) => writer.write(buf)))
}

protected def withCustomIteratee[A, CT <: String](iteratee: Writer => Iteratee[Future, Buf, Unit])(implicit
protected def withCustomIteratee[A, CT <: String](iteratee: Writer[Buf] => Iteratee[Future, Buf, Unit])(implicit
e: Encode.Aux[A, CT],
w: Witness.Aux[CT]
): ToResponse.Aux[Enumerator[Future, A], CT] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class EnumerateEndpointSpec extends FinchSpec with GeneratorDrivenPropertyChecks
enumeratorJsonBody[Buf].toString shouldBe "enumeratorJsonBody"
}

private def write(data: List[Buf], writer: Writer with Closable): Future[Unit] = {
private def write(data: List[Buf], writer: Writer[Buf] with Closable): Future[Unit] = {
data match {
case Nil => writer.close()
case head :: tail => writer.write(head).foreach(_ => write(tail, writer))
Expand Down

0 comments on commit c8344c3

Please sign in to comment.