diff options
-rw-r--r-- | manifest.toml | 6 | ||||
-rw-r--r-- | src/gleam/json.gleam | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/manifest.toml b/manifest.toml index 4eab910..40edfd3 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,9 +2,9 @@ # You typically do not need to edit this file packages = [ - { name = "gleam_stdlib", version = "0.19.2", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "FFA79EA12369F122B68885E694E097D6810402A2F86BFF48AAE9E40ACE654F4C" }, - { name = "gleeunit", version = "0.6.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "5BF486C3E135B7F5ED8C054925FC48E5B2C79016A39F416FD8CF2E860520EE55" }, - { name = "thoas", version = "0.2.0", build_tools = ["rebar3"], requirements = [], otp_app = "thoas", source = "hex", outer_checksum = "630AAEE57FB3FDE201578E787259E15E788A27733D49DE8DCCE1354DB1885B8D" }, + { name = "gleam_stdlib", version = "0.27.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "9DBDD21B48C654182CDD8AA15ACF85E8E74A0438583C68BD7EF08BE89F999C6F" }, + { name = "gleeunit", version = "0.10.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "ECEA2DE4BE6528D36AFE74F42A21CDF99966EC36D7F25DEB34D47DD0F7977BAF" }, + { name = "thoas", version = "0.4.1", build_tools = ["rebar3"], requirements = [], otp_app = "thoas", source = "hex", outer_checksum = "4918D50026C073C4AB1388437132C77A6F6F7C8AC43C60C13758CC0ADCE2134E" }, ] [requirements] diff --git a/src/gleam/json.gleam b/src/gleam/json.gleam index ad61a94..26c8bfc 100644 --- a/src/gleam/json.gleam +++ b/src/gleam/json.gleam @@ -56,7 +56,7 @@ if javascript { from json: String, using decoder: dynamic.Decoder(t), ) -> Result(t, DecodeError) { - try dynamic_value = decode_string(json) + use dynamic_value <- result.then(decode_string(json)) decoder(dynamic_value) |> result.map_error(UnexpectedFormat) } @@ -89,7 +89,7 @@ pub fn decode_bits( from json: BitString, using decoder: dynamic.Decoder(t), ) -> Result(t, DecodeError) { - try dynamic_value = decode_to_dynamic(json) + use dynamic_value <- result.then(decode_to_dynamic(json)) decoder(dynamic_value) |> result.map_error(UnexpectedFormat) } |