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
When registering for trait protobuf_codegen::CustomizeCallback for messages. Derive macros with implemented by structs converted from protobuf messages are placed at first line.
This is probably a design decision to consider only custom derive macros to be added before struct. However I have a scenario where custom implementation for struct has to be added.
Example scenario
message Animal {
string dog = 1;
}
generated struct
Struct Animal {}
Lets say -- assume following code block has to be placed before struct Animal
impl Animal {
pub fn dog() {
todo!()
}
}
then current protobuf-codegen when writing derives for each struct generates the following:
When registering for trait
protobuf_codegen::CustomizeCallback
for messages. Derive macros with implemented by structs converted from protobuf messages are placed at first line.This is probably a design decision to consider only custom derive macros to be added before struct. However I have a scenario where custom implementation for struct has to be added.
Example scenario
generated struct
Lets say -- assume following code block has to be placed before
struct Animal
then current
protobuf-codegen
when writing derives for each struct generates the following:The text was updated successfully, but these errors were encountered: