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
Why not just take Self::InitData directly? If the caller already has a value of type Self::InitData then they won't be able to pass it to init because afaik &T does not implement Into<T>, or if it does it will delegate to clone.
I don't see the upside of passing it by reference. If you know you will need ownership of the data, I would just pass an owned value and leave to the caller to clone it if needed.
It wasn't clear to me if the callee would need ownership, but I double-checked in the bank module and we indeed require ownership. We can leave it as is then!
Currently,
Module::init()
takes ajson
object as input. We should investigate how to make this type-safe.A rough sketch for a possibility would be:
The text was updated successfully, but these errors were encountered: