diff options
author | Louis Pilfold <louis@lpil.uk> | 2022-02-05 09:37:37 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2022-02-05 09:37:37 +0000 |
commit | 6821a758373686042096a3b54f39743532c32aaa (patch) | |
tree | 35993985463cd39b62807e34d8a59f39c276a87d /README.md | |
parent | ce5c3bbbd7f4ed811f9bbaadce05165fe483c4f6 (diff) | |
download | gleam_json-6821a758373686042096a3b54f39743532c32aaa.tar.gz gleam_json-6821a758373686042096a3b54f39743532c32aaa.zip |
decode_bits
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 } |