Skip to content

Commit ffb1cb4

Browse files
committed
1.9.0 format
1 parent e639dba commit ffb1cb4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/wechat/object.gleam

+7-7
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub fn get(o: JsObject, k: k) -> Result(JsObject, WechatError) {
129129
pub fn get_kv(o: JsObject, key k: String) -> Result(JsObject, WechatError) {
130130
dict(o)
131131
|> dict.get(k)
132-
|> result.map_error(NilError(_))
132+
|> result.map_error(NilError)
133133
}
134134

135135
/// set a key `k` with value `v`
@@ -165,7 +165,7 @@ pub fn int(o: JsObject) -> Result(Int, WechatError) {
165165
o
166166
|> dynamic
167167
|> decode.run(decode.int)
168-
|> result.map_error(WechatDecodeError(_))
168+
|> result.map_error(WechatDecodeError)
169169
}
170170

171171
/// convert to float with `gleam/dynamic`
@@ -174,7 +174,7 @@ pub fn float(o: JsObject) -> Result(Float, WechatError) {
174174
o
175175
|> dynamic
176176
|> decode.run(decode.float)
177-
|> result.map_error(WechatDecodeError(_))
177+
|> result.map_error(WechatDecodeError)
178178
}
179179

180180
/// convert to bool with `gleam/dynamic`
@@ -183,7 +183,7 @@ pub fn bool(o: JsObject) -> Result(Bool, WechatError) {
183183
o
184184
|> dynamic
185185
|> decode.run(decode.bool)
186-
|> result.map_error(WechatDecodeError(_))
186+
|> result.map_error(WechatDecodeError)
187187
}
188188

189189
/// convert to string with `gleam/dynamic`
@@ -192,7 +192,7 @@ pub fn string(o: JsObject) -> Result(String, WechatError) {
192192
o
193193
|> dynamic
194194
|> decode.run(decode.string)
195-
|> result.map_error(WechatDecodeError(_))
195+
|> result.map_error(WechatDecodeError)
196196
}
197197

198198
/// retrieve and convert a sub object with key `a` of type `t`
@@ -210,7 +210,7 @@ pub fn field(
210210
o
211211
|> dynamic
212212
|> decode.run(decoder)
213-
|> result.map_error(WechatDecodeError(_))
213+
|> result.map_error(WechatDecodeError)
214214
}
215215

216216
/// convert to `list(t)` with `gleam/dynamic`
@@ -219,5 +219,5 @@ pub fn list(o: JsObject, of f: Decoder(t)) -> Result(List(t), WechatError) {
219219
o
220220
|> dynamic
221221
|> decode.run(decode.list(f))
222-
|> result.map_error(WechatDecodeError(_))
222+
|> result.map_error(WechatDecodeError)
223223
}

0 commit comments

Comments
 (0)