diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-05-15 08:41:57 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-05-15 08:41:57 -0700 |
commit | dc906c679171950807a47ca9821616548e84a2ff (patch) | |
tree | ec071f878e5cf7be850a0fb6d2e35941627d3209 | |
parent | 297eeb335cbc50be9107d3f49cc7eb0487514ca7 (diff) | |
parent | d504017f15692ae72db05118ed2be38daa3b7752 (diff) | |
download | scala-dc906c679171950807a47ca9821616548e84a2ff.tar.gz scala-dc906c679171950807a47ca9821616548e84a2ff.tar.bz2 scala-dc906c679171950807a47ca9821616548e84a2ff.zip |
Merge pull request #4502 from cneijenhuis/documentation/try-example-deprecated
Fixed deprecation warning in scaladoc example of Try
-rw-r--r-- | src/library/scala/util/Try.scala | 5 |
1 files changed, 3 insertions, 2 deletions
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) => |