From ef9a6a50bf45ebeba257d2db7aa1116c348d4fb9 Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Sat, 20 Jan 2024 10:38:43 +0000 Subject: Use optional_field in optional_field docs --- src/gleam/dynamic.gleam | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gleam/dynamic.gleam b/src/gleam/dynamic.gleam index d0a294a..f369465 100644 --- a/src/gleam/dynamic.gleam +++ b/src/gleam/dynamic.gleam @@ -426,7 +426,7 @@ pub fn field(named name: a, of inner_type: Decoder(t)) -> Decoder(t) { /// dict.new() /// |> dict.insert("Hello", "World") /// |> from -/// |> field(named: "Hello", of: string) +/// |> optional_field(named: "Hello", of: string) /// // -> Ok(Some("World")) /// ``` /// @@ -434,13 +434,13 @@ pub fn field(named name: a, of inner_type: Decoder(t)) -> Decoder(t) { /// import gleam/dict /// dict.new() /// |> from -/// |> field(named: "Hello", of: string) +/// |> optional_field(named: "Hello", of: string) /// // -> Ok(None) /// ``` /// /// ```gleam /// from(123) -/// |> field("Hello", string) +/// |> optional_field("Hello", string) /// // -> Error([DecodeError(expected: "Map", found: "Int", path: [])]) /// ``` /// -- cgit v1.2.3