Closed sebastiencs closed 1 year ago
I've added an item here: name-placeholder/bin-prot-rs/issues/3
LGTM @sebastiencs regarding generated code, let's keep it like this for now, since currently it is only possible to add exactly the same
derive
to all types, and here we only should addDeref
to newtype-like structs. I need to extend the generator for that.
@akoptelov Alright, another solution would be to have our own derive trait, like MaybeDeref
, which would implement std::ops::Deref
for new types only. We could then add MaybeDeref
to all the generated types
I've fixed the compilation
This adds
Deref
implementation to tuples with a single element. This is to avoid having to use multiples.0
to reach the inner element, that's a bit confusing to read and write.See this commit for example: https://github.com/name-placeholder/mina-block-verifier-poc/commit/fe5f0f54741ff68d52dcf97ac77303d2496af235
@akoptelov I have manually added
derive_more::Deref
to the generated types (insrc/v2/generated.rs
). Next time those types are automatically generated, would it be possible to addDeref
too ? I'm not sure where they are generated, could you point me to where I could addDeref
automatically ?