Skip to content

Commit 876c386

Browse files
committed
Use mdoc also on conversion snippet
1 parent da50f9e commit 876c386

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

_overviews/collections-2.13/conversion-between-option-and-the-collections.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,14 @@ implicit def option2Iterable[A](xo: Option[A]): Iterable[A]
3535

3636
so although `Option[A]` is not a full collection it can be _viewed_ as one. For example,
3737

38-
```
39-
scala> Some(42).drop(1)
40-
val res0: Iterable[Int] = List()
38+
```scala mdoc
39+
Some(42).drop(1)
4140
```
4241

4342
expands to
4443

45-
```
46-
scala> Option.option2Iterable(Some(42)).drop(1)
47-
val res1: Iterable[Int] = List()
44+
```scala mdoc
45+
Option.option2Iterable(Some(42)).drop(1)
4846
```
4947

5048
because `drop` is not defined on `Option`. A downside of the above implicit conversion is that instead of getting back an `Option[A]` we are left with an `Iterable[A]`. For this reason, `Option`’s documentation carries the following note:

0 commit comments

Comments
 (0)