Closed jkalez closed 9 months ago
I have found that constructing various messages often leads to creating MessageField types explicitly. For example, the following struct may be generated:
MessageField
struct MyStruct { pub some_field: MessageField<MyOtherStruct>, ... pub special_fields: SpecialFields }
I often initialize this as follows:
let s = MyStruct { some_field: MessageField::some(MyOtherStruct { <blah> }), ... };
This PR would allow users to use the blanket provided implementation of Into by deriving From, enabling this simpler syntax:
Into
From
let s = MyStruct { some_field: MyOtherStruct { <blah> }.into(), ... };
This PR adds code commented out.
Closing this PR, please reopen if this change is still needed and PR is fixed.
I have found that constructing various messages often leads to creating
MessageField
types explicitly. For example, the following struct may be generated:I often initialize this as follows:
This PR would allow users to use the blanket provided implementation of
Into
by derivingFrom
, enabling this simpler syntax: