minor improvement

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
This commit is contained in:
Anton-4 2024-02-23 14:08:39 +01:00 committed by GitHub
parent df58a4ff07
commit af389a9792
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -94,10 +94,10 @@ appendWith = \lst, @Encoder doEncoding, fmt -> doEncoding lst fmt
##
## ```
## expect
## actual = Encode.append [] { foo: "Bar" } Core.json
## actual = Encode.append [] { foo: 43 } Core.json
## expected = Str.toUtf8 """{"foo":43}"""
##
## # Check that the list has grown
## !(List.isEmpty actual)
## actual == expected
## ```
append : List U8, val, fmt -> List U8 where val implements Encoding, fmt implements EncoderFormatting
append = \lst, val, fmt -> appendWith lst (toEncoder val) fmt
@ -106,10 +106,10 @@ append = \lst, val, fmt -> appendWith lst (toEncoder val) fmt
##
## ```
## expect
## value = 42
## fooRec = { foo: 42 }
##
## actual = Encode.toBytes value Core.json
## expected = [52, 50] # ASCII codes for 4 and 2
## actual = Encode.toBytes fooRec Core.json
## expected = Str.toUtf8 """{"foo":42}"""
##
## actual == expected
## ```