Skip to content

Commit 48c7c62

Browse files
arturdryomovilya-g
authored andcommitted
Add missing syntax highlighting to readme file.
1 parent 9ca763f commit 48c7c62

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ If the order of elements doesn't matter, more efficient `immutableHashSetOf` and
3030
Converts a read-only or mutable collection to an immutable one.
3131
If 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
5052
standard library.
5153

52-
```
54+
```kotlin
5355
import 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:
5961
get 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

6367
With `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

Comments
 (0)