Skip to content

Commit 03509b8

Browse files
EugeneFlesselleodersky
authored andcommitted
Drop braces remaining at term level
1 parent 40c6138 commit 03509b8

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

library/src/scala/Tuple.scala

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,9 @@ object Tuple:
246246
* constant `true`. A predicate `P[X]` is a type that can be either `true`
247247
* or `false`. For example:
248248
* ```scala
249-
* type IsString[x] <: Boolean = x match {
249+
* type IsString[x] <: Boolean = x match
250250
* case String => true
251251
* case _ => false
252-
* }
253252
* summon[Tuple.Filter[(1, "foo", 2, "bar"), IsString] =:= ("foo", "bar")]
254253
* ```
255254
* @syntax markdown
@@ -325,26 +324,21 @@ object Tuple:
325324
fromArray(xs, xs.length)
326325

327326
/** Convert the first `n` elements of an array into a tuple of unknown arity and types */
328-
def fromArray[T](xs: Array[T], n: Int): Tuple = {
329-
val xs2 = xs match {
327+
def fromArray[T](xs: Array[T], n: Int): Tuple =
328+
val xs2 = xs match
330329
case xs: Array[Object] => xs
331330
case xs => xs.map(_.asInstanceOf[Object])
332-
}
333331
runtime.Tuples.fromArray(xs2, n)
334-
}
335332

336333
/** Convert an immutable array into a tuple of unknown arity and types */
337334
def fromIArray[T](xs: IArray[T]): Tuple = fromIArray(xs, xs.length)
338335

339336
/** Convert the first `n` elements of an immutable array into a tuple of unknown arity and types */
340-
def fromIArray[T](xs: IArray[T], n: Int): Tuple = {
341-
val xs2: IArray[Object] = xs match {
337+
def fromIArray[T](xs: IArray[T], n: Int): Tuple =
338+
val xs2: IArray[Object] = xs match
342339
case xs: IArray[Object] @unchecked => xs
343-
case _ =>
344-
xs.map(_.asInstanceOf[Object])
345-
}
340+
case _ => xs.map(_.asInstanceOf[Object])
346341
runtime.Tuples.fromIArray(xs2, n)
347-
}
348342

349343
/** Convert a Product into a tuple of unknown arity and types */
350344
def fromProduct(product: Product): Tuple =
@@ -394,16 +388,14 @@ end Tuple
394388
type EmptyTuple = EmptyTuple.type
395389

396390
/** A tuple of 0 elements. */
397-
case object EmptyTuple extends Tuple {
391+
case object EmptyTuple extends Tuple:
398392
override def toString(): String = "()"
399-
}
400393

401394
/** Tuple of arbitrary non-zero arity */
402395
sealed trait NonEmptyTuple extends Tuple
403396

404397
@showAsInfix
405398
sealed abstract class *:[+H, +T <: Tuple] extends NonEmptyTuple
406399

407-
object *: {
400+
object `*:`:
408401
def unapply[H, T <: Tuple](x: H *: T): (H, T) = (x.head, x.tail)
409-
}

0 commit comments

Comments
 (0)