summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjxcoder <jxcoder@ya.ru>2014-07-03 11:02:49 +0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-07-25 18:11:23 +0200
commit7cca7635b392cb533d0f8e26b74d7362c0dd3891 (patch)
treefa174c0132498ef6a8b3a8031ac72b963fa23873
parent6987d504f5d260d54d902658813c58e9f055e756 (diff)
downloadscala-7cca7635b392cb533d0f8e26b74d7362c0dd3891.tar.gz
scala-7cca7635b392cb533d0f8e26b74d7362c0dd3891.tar.bz2
scala-7cca7635b392cb533d0f8e26b74d7362c0dd3891.zip
Refactored example to Option.collect method.
-rw-r--r--src/library/scala/Option.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/scala/Option.scala b/src/library/scala/Option.scala
index d263f89bb8..66900e7258 100644
--- a/src/library/scala/Option.scala
+++ b/src/library/scala/Option.scala
@@ -264,13 +264,13 @@ sealed abstract class Option[+A] extends Product with Serializable {
*
* @example {{{
* // Returns Some(HTTP) because the partial function covers the case.
- * Some("http").collect({case "http" => "HTTP"})
+ * Some("http") collect {case "http" => "HTTP"}
*
* // Returns None because the partial function doesn't cover the case.
- * Some("ftp").collect({case "http" => "HTTP"})
+ * Some("ftp") collect {case "http" => "HTTP"}
*
* // Returns None because None is passed to the collect method.
- * None.collect({case value => value})
+ * None collect {case value => value}
* }}}
*
* @param pf the partial function.