Open ik1ne opened 1 year ago
Good point. Let me check if this can simply be added as well.
Same for unpack. A common pattern would be to try to unpack as a series of different types, but taking self
by ownership prevents this and forces you to explicitly check the type url first.
AFAICT it's a trivial change, since self
never actually needs to get consumed in the unpacking functions.
Any::try_pack
takesmessage: T
as parameter, consuming it. However, takingmessage: &T
instead ofmessage: T
would work too, allowing the callers to reusemessage
.