Skip to content

Commit f268422

Browse files
author
Devdutt Shenoi
committed
ci: clippy suggestion
1 parent 5a2bcc1 commit f268422

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/handlers/http/cluster/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl<T: DeserializeOwned + 'static> FromRequest for JsonWithSize<T> {
288288

289289
// Check the size limit
290290
if byte_size > limit {
291-
return Err(ErrorPayloadTooLarge(byte_size).into());
291+
return Err(ErrorPayloadTooLarge(byte_size));
292292
}
293293

294294
// Extend our buffer with the chunk
@@ -299,8 +299,8 @@ impl<T: DeserializeOwned + 'static> FromRequest for JsonWithSize<T> {
299299
let bytes = body.freeze();
300300

301301
// Deserialize the JSON payload
302-
let json = serde_json::from_slice::<T>(&bytes)
303-
.map_err(|e| JsonPayloadError::Deserialize(e))?;
302+
let json =
303+
serde_json::from_slice::<T>(&bytes).map_err(JsonPayloadError::Deserialize)?;
304304

305305
Ok(JsonWithSize { json, byte_size })
306306
})

0 commit comments

Comments
 (0)