Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit d504017

Browse files
committed
Fixed deprecation warning in scaladoc example of Try
1 parent 4b0e3bc commit d504017

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/library/scala/util/Try.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ import scala.language.implicitConversions
2424
*
2525
* Example:
2626
* {{{
27+
* import scala.io.StdIn
2728
* import scala.util.{Try, Success, Failure}
2829
*
2930
* def divide: Try[Int] = {
30-
* val dividend = Try(Console.readLine("Enter an Int that you'd like to divide:\n").toInt)
31-
* val divisor = Try(Console.readLine("Enter an Int that you'd like to divide by:\n").toInt)
31+
* val dividend = Try(StdIn.readLine("Enter an Int that you'd like to divide:\n").toInt)
32+
* val divisor = Try(StdIn.readLine("Enter an Int that you'd like to divide by:\n").toInt)
3233
* val problem = dividend.flatMap(x => divisor.map(y => x/y))
3334
* problem match {
3435
* case Success(v) =>

0 commit comments

Comments
 (0)