Skip to content

Commit d7ed4ad

Browse files
committed
Moved OptionOpsExtensions from scala.collection.next to scala.next
1 parent 9225331 commit d7ed4ad

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

src/main/scala/scala/collection/next/package.scala

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,4 @@ package object next {
1919
col: IterableOnceOps[A, CC, C]
2020
): NextIterableOnceOpsExtensions[A, CC, C] =
2121
new NextIterableOnceOpsExtensions(col)
22-
23-
implicit final class OptionOpsExtensions[A](val v: Option[A]) extends AnyVal {
24-
/** Apply the side-effecting function `f` to the option's value
25-
* if it is nonempty. Otherwise, do nothing.
26-
*
27-
* @param f a function to apply to the option's value
28-
* @return the option
29-
*/
30-
def tapEach[B](f: A => B): Option[A] = { v.foreach(f); v }
31-
}
3222
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Scala (https://www.scala-lang.org)
3+
*
4+
* Copyright EPFL and Lightbend, Inc.
5+
*
6+
* Licensed under Apache License 2.0
7+
* (http://www.apache.org/licenses/LICENSE-2.0).
8+
*
9+
* See the NOTICE file distributed with this work for
10+
* additional information regarding copyright ownership.
11+
*/
12+
13+
package scala
14+
15+
package object next {
16+
implicit final class OptionOpsExtensions[A](val v: Option[A]) extends AnyVal {
17+
/** Apply the side-effecting function `f` to the option's value
18+
* if it is nonempty. Otherwise, do nothing.
19+
*
20+
* @param f a function to apply to the option's value
21+
* @return the option
22+
*/
23+
def tapEach[B](f: A => B): Option[A] = { v.foreach(f); v }
24+
}
25+
}

src/test/scala/scala/collection/next/TestOptionOpsExtensions.scala renamed to src/test/scala/scala/next/TestOptionOpsExtensions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* additional information regarding copyright ownership.
1111
*/
1212

13-
package scala.collection.next
13+
package scala.next
1414

1515
final class TestOptionOpsExtensions {
1616
// Compile checks the return type, no need to run as test.

0 commit comments

Comments
 (0)