Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some unneeded typecasts. #2430

Merged
merged 1 commit into from
Jun 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions core/shared/src/main/scala/fs2/Pull.scala
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ object Pull extends PullLowPriority {
val next = outView match {
case _: EvalView[G, X] => fmoc
case bv: BindView[G, X, Unit] =>
val del = bv.b.asInstanceOf[Bind[G, X, Unit, Unit]].delegate
val del = bv.b.delegate
new Bind[G, X, Unit, Unit](fmoc) {
override val delegate: Bind[G, X, Unit, Unit] = del
def cont(yr: Terminal[Unit]): Pull[G, X, Unit] = delegate.cont(yr)
Expand Down Expand Up @@ -1215,13 +1215,10 @@ object Pull extends PullLowPriority {
} catch {
case NonFatal(e) =>
viewL(tail) match {
case Succeeded(_) => F.raiseError(e)
case Fail(e2) => F.raiseError(CompositeFailure(e2, e))
case Interrupted(_, err) =>
F.raiseError(err.fold(e)(t => CompositeFailure(e, t)))
case v0: View[F, O, _] =>
val v = v0.asInstanceOf[View[F, O, Unit]]
go[F, O, B](scope, None, initFk, self, v(Fail(e)))
case Succeeded(_) => F.raiseError(e)
case Fail(e2) => F.raiseError(CompositeFailure(e2, e))
case Interrupted(_, err) => F.raiseError(err.fold(e)(t => CompositeFailure(e, t)))
case v: View[F, O, _] => go[F, O, B](scope, None, initFk, self, v(Fail(e)))
}
}
}
Expand Down