You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, during deserialization, data is always copied from the deserializer when deserializing into a Cow, which always results in a Cow::Owned, thus copying the data.
There seem to be ways to mitigate this (e.g. using #[serde(borrow)] or introducing serde_with::BorrowCow). When I tried this out briefly, I ended up sprinkling borrow all over the place, not sure, if this is actually required.
Also, adding validation to the deserialization through try_from seems to have complicated things to be less straightforward.
I'm sure there is some good way of doing this optimization.
The text was updated successfully, but these errors were encountered:
Currently, during deserialization, data is always copied from the deserializer when deserializing into a
Cow
, which always results in aCow::Owned
, thus copying the data.There seem to be ways to mitigate this (e.g. using
#[serde(borrow)]
or introducingserde_with::BorrowCow
). When I tried this out briefly, I ended up sprinklingborrow
all over the place, not sure, if this is actually required.Also, adding validation to the deserialization through
try_from
seems to have complicated things to be less straightforward.I'm sure there is some good way of doing this optimization.
The text was updated successfully, but these errors were encountered: