aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2023-03-02 10:39:51 +0000
committerLouis Pilfold <louis@lpil.uk>2023-03-02 10:39:51 +0000
commit2cc76387ec480755a6af515e94dbe6788fbe2e90 (patch)
tree78732311b83ddbc64d16ba50971c3be32df4f2c2 /src
parentb2aa1e5715e0b3731e3670e0889ea6e8b506c956 (diff)
downloadgleam_json-2cc76387ec480755a6af515e94dbe6788fbe2e90.tar.gz
gleam_json-2cc76387ec480755a6af515e94dbe6788fbe2e90.zip
Upgrade for v0.27.0
Diffstat (limited to 'src')
-rw-r--r--src/gleam/json.gleam4
1 files changed, 2 insertions, 2 deletions
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)
}