Skip to content

Commit 1ccfee3

Browse files
committed
Tweak the case in patmat
1 parent 5d74ad5 commit 1ccfee3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎core/src/main/scala/cats/syntax/either.scala‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ final class EitherOps[A, B](private val eab: Either[A, B]) extends AnyVal {
196196

197197
def leftMapOrKeep[AA >: A](pf: PartialFunction[A, AA]): Either[AA, B] =
198198
eab match {
199-
case Left(a) => Left(pf.applyOrElse(a, identity[AA]))
200-
case r @ Right(_) => r
199+
case Left(a) => Left(pf.applyOrElse(a, identity[AA]))
200+
case r: Right[A, B] => r
201201
}
202202

203203
@deprecated("Included in the standard library", "2.1.0-RC1")
@@ -215,8 +215,8 @@ final class EitherOps[A, B](private val eab: Either[A, B]) extends AnyVal {
215215

216216
def leftFlatMapOrKeep[AA >: A, BB >: B](pfa: PartialFunction[A, Either[AA, BB]]): Either[AA, BB] =
217217
eab match {
218-
case l @ Left(a) => pfa.applyOrElse(a, (_: A) => l)
219-
case r @ Right(_) => r
218+
case l @ Left(a) => pfa.applyOrElse(a, (_: A) => l)
219+
case r: Right[A, B] => r
220220
}
221221

222222
def compare[AA >: A, BB >: B](that: Either[AA, BB])(implicit AA: Order[AA], BB: Order[BB]): Int =

0 commit comments

Comments
 (0)