Skip to content

Commit ea39daf

Browse files
authored
Fix typos and grammar in formats.md (#988)
1 parent c68b475 commit ea39daf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/formats.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ A decoder needs to implements more substance.
530530
in the `elementIndex` variable. See
531531
the [Hand-written composite serializer](serializers.md#hand-written-composite-serializer) section
532532
on how it ends up being used.
533-
* [beginStructure][Decoder.beginStructure] &must; returns a new instance of the `ListDecoder`, so that
533+
* [beginStructure][Decoder.beginStructure] — returns a new instance of the `ListDecoder`, so that
534534
each structure that is being recursively decoded keeps track of its own `elementIndex` state separately.
535535

536536
```kotlin
@@ -676,9 +676,9 @@ Project(name=kotlinx.serialization, owner=User(name=kotlin), votes=9000)
676676

677677
### Adding collection support
678678

679-
This basic format, so far, cannot property represent collections. In encodes them, but it does not keep
680-
track on how many elements are there in the collection or where it ends, so it cannot properly decode them.
681-
First, let us add propers support for collections to the encoder by implementing the
679+
This basic format, so far, cannot properly represent collections. In encodes them, but it does not keep
680+
track of how many elements are there in the collection or where it ends, so it cannot properly decode them.
681+
First, let us add proper support for collections to the encoder by implementing the
682682
[Encoder.beginCollection] function. The `beginCollection` function takes a collection size as a parameter,
683683
so we encode it to add it to the result.
684684
Our encoder implementation does not keep any state, so it just returns `this` from the `beginCollection` function.
@@ -716,7 +716,7 @@ inline fun <reified T> encodeToList(value: T) = encodeToList(serializer(), value
716716
-->
717717

718718
The decoder, for our case, needs to only implement the [CompositeDecoder.decodeCollectionSize] function
719-
in addition the previous code.
719+
in addition to the previous code.
720720

721721
> The formats that store collection size in advance have to return `true` from `decodeSequentially`.
722722

0 commit comments

Comments
 (0)