diff --git a/akka-http-core/src/main/scala/akka/http/util/FastFuture.scala b/akka-http-core/src/main/scala/akka/http/util/FastFuture.scala index c1fdcc5b71..100235cdf5 100644 --- a/akka-http-core/src/main/scala/akka/http/util/FastFuture.scala +++ b/akka-http-core/src/main/scala/akka/http/util/FastFuture.scala @@ -26,8 +26,9 @@ class FastFuture[A](val future: Future[A]) extends AnyVal { transformWith(f, FastFuture.failed) def filter(pred: A ⇒ Boolean)(implicit executor: ExecutionContext): Future[A] = - flatMap { - r ⇒ if (pred(r)) future else throw new NoSuchElementException("Future.filter predicate is not satisfied") + flatMap { r ⇒ + if (pred(r)) future + else throw new NoSuchElementException("Future.filter predicate is not satisfied") // FIXME: avoid stack trace generation } def foreach(f: A ⇒ Unit)(implicit ec: ExecutionContext): Unit = map(f) diff --git a/akka-http/src/main/scala/akka/http/marshalling/Marshaller.scala b/akka-http/src/main/scala/akka/http/marshalling/Marshaller.scala index db8594f7f7..5a0007edbe 100644 --- a/akka-http/src/main/scala/akka/http/marshalling/Marshaller.scala +++ b/akka-http/src/main/scala/akka/http/marshalling/Marshaller.scala @@ -68,14 +68,14 @@ object Marshaller /** * Helper for creating a "super-marshaller" from a number of "sub-marshallers". - * Content-negotiation determines, which "sub-marshallers" eventually gets to do the job. + * Content-negotiation determines, which "sub-marshaller" eventually gets to do the job. */ def oneOf[A, B](marshallers: Marshaller[A, B]*)(implicit ec: ExecutionContext): Marshaller[A, B] = Marshaller { a ⇒ FastFuture.sequence(marshallers.map(_(a))).fast.map(_.flatten.toList) } /** * Helper for creating a "super-marshaller" from a number of values and a function producing "sub-marshallers" - * from these values. Content-negotiation determines, which "sub-marshallers" eventually gets to do the job. + * from these values. Content-negotiation determines, which "sub-marshaller" eventually gets to do the job. */ def oneOf[T, A, B](values: T*)(f: T ⇒ Marshaller[A, B])(implicit ec: ExecutionContext): Marshaller[A, B] = oneOf(values map f: _*)