diff options
author | jxcoder <jxcoder@ya.ru> | 2014-07-03 11:02:49 +0700 |
---|---|---|
committer | Antoine Gourlay <antoine@gourlay.fr> | 2014-08-11 17:55:57 +0200 |
commit | 2b78c32b42b55b96834df31824fdb081a095cf5f (patch) | |
tree | 79efe5fa4526df6f173be40b2330d8f64df7ff12 /src/library | |
parent | cb2cfc0bf608a45c5a9948152aae55ce455c4e14 (diff) | |
download | scala-2b78c32b42b55b96834df31824fdb081a095cf5f.tar.gz scala-2b78c32b42b55b96834df31824fdb081a095cf5f.tar.bz2 scala-2b78c32b42b55b96834df31824fdb081a095cf5f.zip |
[backport] Refactored example to Option.collect method.
(cherry picked from commit 7cca7635b392cb533d0f8e26b74d7362c0dd3891)
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/Option.scala | 6 |
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. |