File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -471,8 +471,8 @@ println(upper.getOrElse(""))</code></pre></td>
471
471
<td ><pre class =" highlight " ><code >optionOfOption.flatten</code ></pre >
472
472
<em ><strong >same as</strong ></em >
473
473
<pre class =" highlight " ><code >optionOfOption match {
474
- case Some(Some(x)) => ; Some(x)
475
- case _ => ; None
474
+ case Some(x: Option [ _ ] ) => ; x
475
+ case None => ; None
476
476
}</code ></pre ></td >
477
477
<td >Extract nested option.</td >
478
478
</tr >
@@ -503,8 +503,7 @@ println(upper.getOrElse(""))</code></pre></td>
503
503
<pre class =" highlight " ><code >option match {
504
504
case Some(x)
505
505
if f.isDefinedAt(x) => ; ...
506
- case Some(_ ) => ; None
507
- case None => ; None
506
+ case _ => ; None
508
507
}</code ></pre ></td >
509
508
<td >Apply partial pattern match on optional value</td >
510
509
</tr >
You can’t perform that action at this time.
0 commit comments