aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Janiczek <martin@janiczek.cz>2022-02-06 01:56:03 +0100
committerLouis Pilfold <louis@lpil.uk>2022-02-06 19:21:12 +0000
commit9e53dfc944c481fdb7462589bbf0f9e09af8ce01 (patch)
treeec1ca073d1ada006057c5dd5fdd535dc16f5c603
parentd35a33aa229537cdf9418ced39a666f855f47854 (diff)
downloadgleam_json-9e53dfc944c481fdb7462589bbf0f9e09af8ce01.tar.gz
gleam_json-9e53dfc944c481fdb7462589bbf0f9e09af8ce01.zip
Fix array encoding in README example
-rw-r--r--README.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/README.md b/README.md
index dddcf6c..455ce08 100644
--- a/README.md
+++ b/README.md
@@ -17,14 +17,14 @@ gleam add gleam_json
```rust
import myapp.{Cat}
-import gleam/json.{object, string, mapped_array, int, null}
+import gleam/json.{object, string, array, int, null}
pub fn cat_to_json(cat: Cat) -> String {
object([
#("name", string(cat.name)),
#("lives", int(cat.lives),
#("flaws", null()),
- #("nicknames", mapped_array(cat.nicknames, of: string)),
+ #("nicknames", array(cat.nicknames, of: string)),
])
|> json.to_string
}