Skip to content

Commit

Permalink
minibytes: slightly optimize Bytes serde deserialize
Browse files Browse the repository at this point in the history
Summary:
According to https://docs.rs/serde/latest/serde/trait.Deserializer.html#tymethod.deserialize_byte_buf
it seems `deserialize_byte_buf` is a better choice than `deserialize_bytes`.

Reviewed By: muirdm

Differential Revision: D64833693

fbshipit-source-id: f3dd6c2ecc3192413f4910cd088a9193135f04fd
  • Loading branch information
quark-zju authored and facebook-github-bot committed Oct 23, 2024
1 parent 585ce0a commit b2857d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eden/scm/lib/minibytes/src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl<'de> de::Visitor<'de> for BytesVisitor {

impl<'de> Deserialize<'de> for Bytes {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
deserializer.deserialize_bytes(BytesVisitor)
deserializer.deserialize_byte_buf(BytesVisitor)
}
}

Expand Down

0 comments on commit b2857d1

Please sign in to comment.