File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ package scala
1515package object next {
1616 implicit final class OptionOpsExtensions [A ](val v : Option [A ]) extends AnyVal {
1717 /** 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- */
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+ */
2323 def tapEach [B ](f : A => B ): Option [A ] = { v.foreach(f); v }
2424 }
2525}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ package scala.next
1515final class TestOptionOpsExtensions {
1616 // Compile checks the return type, no need to run as test.
1717 def tapEachReturnType (): Option [Int ] = {
18- // Don't return the Option directly, so the compiler is not able to coerce a specific implicit to be used.
18+ // Don't return the option directly, so the compiler is not able to coerce a specific implicit to be used.
1919 val opt = Option (5 ).tapEach(identity)
2020 opt.map(identity)
2121 }
You can’t perform that action at this time.
0 commit comments