Skip to content

Commit

Permalink
formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
ValdemarGr committed Sep 9, 2024
1 parent 8618a9f commit 228763a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/shared/src/main/scala/fs2/internal/Scope.scala
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ private[fs2] final class Scope[F[_]] private (
* finalized after this scope is closed, but they will get finalized shortly after. See [[ScopedResource]] for
* more details.
*/
def close(ec: Resource.ExitCase): F[Either[Throwable, Unit]] =
def close(ec: Resource.ExitCase): F[Either[Throwable, Unit]] =
F.uncancelable(_ => close_(ec))

private def close_(ec: Resource.ExitCase): F[Either[Throwable, Unit]] = {
private def close_(ec: Resource.ExitCase): F[Either[Throwable, Unit]] =
state.modify(s => Scope.State.closed -> s).flatMap {
case previous: Scope.State.Open[F] =>
for {
Expand All @@ -272,7 +272,6 @@ private[fs2] final class Scope[F[_]] private (
} yield CompositeFailure.fromResults(resultChildren, resultResources)
case _: Scope.State.Closed[F] => F.pure(Right(()))
}
}

/** Like `openAncestor` but returns self if open. */
private def openScope: F[Scope[F]] =
Expand Down

0 comments on commit 228763a

Please sign in to comment.