From 1889ac98f4979888568790e7bb0e9714da4e7439 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Sat, 1 Jan 2022 16:25:07 +0000 Subject: Update example --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0fc8f04..eb36512 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ pub fn cat_to_json(cat: Cat) -> String { #("name", string(cat.name)), #("lives", int(9), #("flaws", null()), - #("nicknames", list([string("Kitty"), string("Sweetie")])), + #("nicknames", array(["Kitty", "Sweetie"], of: string)), ]) |> json.to_string } @@ -28,12 +28,12 @@ JSON is decoded into a `Dynamic` value which can be decoded using the ```rust import myapp.{Cat} import gleam/json -import gleam/dynamic.{DecodeError} +import gleam/dynamic import gleam/result pub type MyError { - InvalidJson - InvalidFormat(DecodeError) + InvalidJson(json.DecodeError) + InvalidFormat(dynamic.DecodeError) } pub fn cat_from_json(json: String) -> Result { -- cgit v1.2.3