diff options
author | Martin Janiczek <martin@janiczek.cz> | 2022-02-06 01:56:03 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2022-02-06 19:21:12 +0000 |
commit | 9e53dfc944c481fdb7462589bbf0f9e09af8ce01 (patch) | |
tree | ec1ca073d1ada006057c5dd5fdd535dc16f5c603 | |
parent | d35a33aa229537cdf9418ced39a666f855f47854 (diff) | |
download | gleam_json-9e53dfc944c481fdb7462589bbf0f9e09af8ce01.tar.gz gleam_json-9e53dfc944c481fdb7462589bbf0f9e09af8ce01.zip |
Fix array encoding in README example
-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, 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 } |