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 @@ -470,8 +470,8 @@ println(upper.getOrElse(""))</code></pre></td>
470
470
<td ><pre class =" highlight " ><code >optionOfOption.flatten</code ></pre >
471
471
<em ><strong >same as</strong ></em >
472
472
<pre class =" highlight " ><code >optionOfOption match {
473
- case Some(Some(x)) => ; Some(x)
474
- case _ => ; None
473
+ case Some(x: Option [ _ ] ) => ; x
474
+ case None => ; None
475
475
}</code ></pre ></td >
476
476
<td >Extract nested option.</td >
477
477
</tr >
@@ -502,8 +502,7 @@ println(upper.getOrElse(""))</code></pre></td>
502
502
<pre class =" highlight " ><code >option match {
503
503
case Some(x)
504
504
if f.isDefinedAt(x) => ; ...
505
- case Some(_ ) => ; None
506
- case None => ; None
505
+ case _ => ; None
507
506
}</code ></pre ></td >
508
507
<td >Apply partial pattern match on optional value</td >
509
508
</tr >
You can’t perform that action at this time.
0 commit comments