Thanks to visit codestin.com
Credit goes to Github.com

Skip to content
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
16 changes: 7 additions & 9 deletions streams/shared/src/main/scala/zio/stream/ZChannel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1644,20 +1644,18 @@ object ZChannel {
private[zio] final case class Finalizer[Env, OutErr, OutDone](finalizer: Exit[OutErr, OutDone] => URIO[Env, Any])
extends Continuation[Env, Any, Any, Any, OutErr, Nothing, Nothing, OutDone, Nothing]

private[this] def SuccessIdentity(implicit
trace: Trace
): Any => ZChannel[Any, Any, Any, Any, Nothing, Nothing, Any] =
ZChannel.succeedNow(_)
private[this] val SuccessIdentity: Any => ZChannel[Any, Any, Any, Any, Nothing, Nothing, Any] =
ZChannel.succeedNow(_)(Trace.empty)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be best to instantiate the class directly.


private[zio] def successIdentity[Z](implicit trace: Trace): Z => ZChannel[Any, Any, Any, Any, Nothing, Nothing, Z] =
private[stream] def successIdentity[Z](implicit
trace: Trace
): Z => ZChannel[Any, Any, Any, Any, Nothing, Nothing, Z] =
SuccessIdentity.asInstanceOf[Z => ZChannel[Any, Any, Any, Any, Nothing, Nothing, Z]]

private[this] def FailCauseIdentity(implicit
trace: Trace
): Cause[Any] => ZChannel[Any, Any, Any, Any, Any, Nothing, Nothing] =
private[this] val FailCauseIdentity: Cause[Any] => ZChannel[Any, Any, Any, Any, Any, Nothing, Nothing] =
ZChannel.refailCause

private[zio] def failCauseIdentity[E](implicit
private[stream] def failCauseIdentity[E](implicit
trace: Trace
): Cause[E] => ZChannel[Any, Any, Any, Any, E, Nothing, Nothing] =
FailCauseIdentity.asInstanceOf[Cause[E] => ZChannel[Any, Any, Any, Any, E, Nothing, Nothing]]
Expand Down