@@ -30,8 +30,10 @@ If the order of elements doesn't matter, more efficient `immutableHashSetOf` and
3030Converts a read-only or mutable collection to an immutable one.
3131If the receiver is already immutable and has the required type, returns itself.
3232
33- fun Iterable<T>.toImmutableList(): ImmutableList<T>
34- fun Iterable<T>.toImmutableSet(): ImmutableSet<T>
33+ ``` kotlin
34+ fun Iterable<T>.toImmutableList (): ImmutableList <T >
35+ fun Iterable<T>.toImmutableSet (): ImmutableSet <T >
36+ ```
3537
3638#### ` + ` and ` - ` operators
3739
@@ -49,7 +51,7 @@ val newList = immutableListOf("a", "b") + "c"
4951 in order for them to take the precedence over the ones from the
5052standard library.
5153
52- ```
54+ ``` kotlin
5355import kotlinx.collections.immutable.*
5456```
5557
@@ -58,11 +60,15 @@ import kotlinx.collections.immutable.*
5860` mutate ` extension function simplifies quite common pattern of immutable collection modification:
5961get a builder, apply some mutating operations on it, transform it back to an immutable collection:
6062
61- collection.builder().apply { some_actions_on(this) }.build()
63+ ``` kotlin
64+ collection.builder().apply { some_actions_on(this ) }.build()
65+ ```
6266
6367With ` mutate ` it transforms to:
6468
65- collection.mutate { some_actions_on(it) }
69+ ``` kotlin
70+ collection.mutate { some_actions_on(it) }
71+ ```
6672
6773## Using in your projects
6874
0 commit comments