aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md6
1 files changed, 2 insertions, 4 deletions
diff --git a/README.md b/README.md
index 415a654..0fc8f04 100644
--- a/README.md
+++ b/README.md
@@ -5,13 +5,10 @@ Work with JSON in Gleam!
### Encoding
```rust
+import myapp.{Cat}
import gleam/list
import gleam/json.{object, string, list, int, null}
-pub type Cat {
- Cat(name: String)
-}
-
pub fn cat_to_json(cat: Cat) -> String {
object([
#("name", string(cat.name)),
@@ -29,6 +26,7 @@ JSON is decoded into a `Dynamic` value which can be decoded using the
`gleam/dynamic` module from the Gleam standard library.
```rust
+import myapp.{Cat}
import gleam/json
import gleam/dynamic.{DecodeError}
import gleam/result