aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaiwu <kaiwu2004@gmail.com>2025-03-17 16:19:24 +0800
committerkaiwu <kaiwu2004@gmail.com>2025-03-17 16:19:24 +0800
commitffb1cb41f33eb0b3a2f7bc7213c9da6eb75fedcd (patch)
tree141bd204d72a6473c6806ea87ab7f6fa49a9c38b
parente639dba411d2ef863f57b895f36c97f5ffbf82fa (diff)
downloadwechat-ffb1cb41f33eb0b3a2f7bc7213c9da6eb75fedcd.tar.gz
wechat-ffb1cb41f33eb0b3a2f7bc7213c9da6eb75fedcd.zip
1.9.0 format
-rw-r--r--src/wechat/object.gleam14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/wechat/object.gleam b/src/wechat/object.gleam
index 4cd63ee..7f9a16e 100644
--- a/src/wechat/object.gleam
+++ b/src/wechat/object.gleam
@@ -129,7 +129,7 @@ pub fn get(o: JsObject, k: k) -> Result(JsObject, WechatError) {
pub fn get_kv(o: JsObject, key k: String) -> Result(JsObject, WechatError) {
dict(o)
|> dict.get(k)
- |> result.map_error(NilError(_))
+ |> result.map_error(NilError)
}
/// set a key `k` with value `v`
@@ -165,7 +165,7 @@ pub fn int(o: JsObject) -> Result(Int, WechatError) {
o
|> dynamic
|> decode.run(decode.int)
- |> result.map_error(WechatDecodeError(_))
+ |> result.map_error(WechatDecodeError)
}
/// convert to float with `gleam/dynamic`
@@ -174,7 +174,7 @@ pub fn float(o: JsObject) -> Result(Float, WechatError) {
o
|> dynamic
|> decode.run(decode.float)
- |> result.map_error(WechatDecodeError(_))
+ |> result.map_error(WechatDecodeError)
}
/// convert to bool with `gleam/dynamic`
@@ -183,7 +183,7 @@ pub fn bool(o: JsObject) -> Result(Bool, WechatError) {
o
|> dynamic
|> decode.run(decode.bool)
- |> result.map_error(WechatDecodeError(_))
+ |> result.map_error(WechatDecodeError)
}
/// convert to string with `gleam/dynamic`
@@ -192,7 +192,7 @@ pub fn string(o: JsObject) -> Result(String, WechatError) {
o
|> dynamic
|> decode.run(decode.string)
- |> result.map_error(WechatDecodeError(_))
+ |> result.map_error(WechatDecodeError)
}
/// retrieve and convert a sub object with key `a` of type `t`
@@ -210,7 +210,7 @@ pub fn field(
o
|> dynamic
|> decode.run(decoder)
- |> result.map_error(WechatDecodeError(_))
+ |> result.map_error(WechatDecodeError)
}
/// convert to `list(t)` with `gleam/dynamic`
@@ -219,5 +219,5 @@ pub fn list(o: JsObject, of f: Decoder(t)) -> Result(List(t), WechatError) {
o
|> dynamic
|> decode.run(decode.list(f))
- |> result.map_error(WechatDecodeError(_))
+ |> result.map_error(WechatDecodeError)
}