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
Return Option<ConnectionEnd> instead of Option<&ConnectionEnd> in ConnectionReader::connection_end.
Problem Definition
There are two motivations for this change:
The ConnectionReader trait's methods mostly return owned values (client_state returns a Option<AnyClientState>, host_consensus_state returns an owned value too), the only exception being connection_end which returns an Option<&ConnectionEnd>. For the sake of consistency, all methods should return either owned or borrowed values.
The ClientReader trait's methods return owned values, too.
More importantly, as I expect that most stores will use a raw byte storage format (tell me if I'm wrong) and thus need to de-serialize and allocate a new struct, it makes more sense to return objects rather than references. Due to the ownership system, returning data owned by the connection_end function can probably be worked around, but it doesn't seems to be ideal.
Crate
ibc
Summary
Return
Option<ConnectionEnd>
instead ofOption<&ConnectionEnd>
inConnectionReader::connection_end
.Problem Definition
There are two motivations for this change:
ConnectionReader
trait's methods mostly return owned values (client_state
returns aOption<AnyClientState>
,host_consensus_state
returns an owned value too), the only exception beingconnection_end
which returns anOption<&ConnectionEnd>
. For the sake of consistency, all methods should return either owned or borrowed values.The
ClientReader
trait's methods return owned values, too.connection_end
function can probably be worked around, but it doesn't seems to be ideal.Proposal
You can see the required changes here.
Note that is is a breaking change.
For Admin Use
The text was updated successfully, but these errors were encountered: