From d504017f15692ae72db05118ed2be38daa3b7752 Mon Sep 17 00:00:00 2001 From: Christoph Neijenhuis Date: Fri, 15 May 2015 10:17:28 +0200 Subject: Fixed deprecation warning in scaladoc example of Try --- src/library/scala/util/Try.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/library') diff --git a/src/library/scala/util/Try.scala b/src/library/scala/util/Try.scala index f65c77f5a0..0a6a7972c2 100644 --- a/src/library/scala/util/Try.scala +++ b/src/library/scala/util/Try.scala @@ -24,11 +24,12 @@ import scala.language.implicitConversions * * Example: * {{{ + * import scala.io.StdIn * import scala.util.{Try, Success, Failure} * * def divide: Try[Int] = { - * val dividend = Try(Console.readLine("Enter an Int that you'd like to divide:\n").toInt) - * val divisor = Try(Console.readLine("Enter an Int that you'd like to divide by:\n").toInt) + * val dividend = Try(StdIn.readLine("Enter an Int that you'd like to divide:\n").toInt) + * val divisor = Try(StdIn.readLine("Enter an Int that you'd like to divide by:\n").toInt) * val problem = dividend.flatMap(x => divisor.map(y => x/y)) * problem match { * case Success(v) => -- cgit v1.2.3