-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various range_de
/ prefix_de
improvements
#464
Comments
I would be happy to see this as a small PR first, and fit it in 0.10.0. The rest can follow later. |
Working on this, but my take is that a method In the first case, we pass an owned value, that we can directly use / consume. But, this value is being copied as argument, when calling the function. A third option would be to have a signature like I can publish the PR if you want, but my opinion is we leave this just as it is. In the case of a "raw" deserialization to Perhaps adding |
No, the one place this is called in non-test code, we have |
If you want to support both calls in the trait, with a default implementation that |
You say that that argument is not being copied? I guess we would need to inspect that with a debugger, to be sure. |
OK, I'll do that. |
Huh? I am just saying that we don't need to add a clone to convert current usage of Supporting both is more flexible if we do call it other places. |
A number of slight improvements to the current impl:
Replace(done in Key deserializer improvements #467)KeyDeserializer::from_slice(&[u8])
withKeyDeserializer::from_vec(Vec<u8>)
. When we call it, we can consume the Vec and save a clone. See deserialize_kv.Make a(won't do)K::Owned: Deserializable
trait attribute.String
,Vec<u8>
would havetype Deserializable = Self
.&str
would havetype Deserializable = String
, for example. The idea behind this is to try to avoid having to declareK
asDeserializable
, that is, moving / enforcing theDeserializable
bound toK::Output
instead.Add a. (not needed with key deserialization already working)from_length_prefixed
helper, and use it / call it where needed#432 follow-up.
The text was updated successfully, but these errors were encountered: