aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2022-02-05 09:37:37 +0000
committerLouis Pilfold <louis@lpil.uk>2022-02-05 09:37:37 +0000
commit6821a758373686042096a3b54f39743532c32aaa (patch)
tree35993985463cd39b62807e34d8a59f39c276a87d /README.md
parentce5c3bbbd7f4ed811f9bbaadce05165fe483c4f6 (diff)
downloadgleam_json-6821a758373686042096a3b54f39743532c32aaa.tar.gz
gleam_json-6821a758373686042096a3b54f39743532c32aaa.zip
decode_bits
Diffstat (limited to 'README.md')
-rw-r--r--README.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/README.md b/README.md
index 455ce08..dddcf6c 100644
--- a/README.md
+++ b/README.md
@@ -17,14 +17,14 @@ gleam add gleam_json
```rust
import myapp.{Cat}
-import gleam/json.{object, string, array, int, null}
+import gleam/json.{object, string, mapped_array, int, null}
pub fn cat_to_json(cat: Cat) -> String {
object([
#("name", string(cat.name)),
#("lives", int(cat.lives),
#("flaws", null()),
- #("nicknames", array(cat.nicknames, of: string)),
+ #("nicknames", mapped_array(cat.nicknames, of: string)),
])
|> json.to_string
}