aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2022-01-01 15:55:36 +0000
committerLouis Pilfold <louis@lpil.uk>2022-01-01 15:55:36 +0000
commitcdcf2fffcc49e0d5d24708cb54169a96fa356054 (patch)
treeac09fa2c81e8802c70e6cd35fc7186fb3ca74b45 /README.md
parentb2d421a778fc9d203acae92e3e0590de1d536d44 (diff)
downloadgleam_json-cdcf2fffcc49e0d5d24708cb54169a96fa356054.tar.gz
gleam_json-cdcf2fffcc49e0d5d24708cb54169a96fa356054.zip
Update docs
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 108913d..415a654 100644
--- a/README.md
+++ b/README.md
@@ -13,13 +13,13 @@ pub type Cat {
}
pub fn cat_to_json(cat: Cat) -> String {
- let data = object([
+ object([
#("name", string(cat.name)),
#("lives", int(9),
#("flaws", null()),
#("nicknames", list([string("Kitty"), string("Sweetie")])),
])
- json.encode(data)
+ |> json.to_string
}
```