Use `From` instead of `Into` for state changes
For converting from the transaction receipt `StateChange` to state's
`StateChange`, use a `From` implementation rather than `Into`. This the
preferred way to implement conversions in Rust.
Also removes an unecessary doc comment for a trait method.
@@ -50,10 +50,9 @@ impl StateChange {
}
}
-impl Into<state::StateChange> for StateChange {
- /// Converts this modules StateChange into state::StateChange enum
- fn into(self) -> state::StateChange {
- match self {
+impl From<StateChange> for state::StateChange {
+ fn from(state_change: StateChange) -> Self {
+ match state_change {
StateChange::Set { key, value } => state::StateChange::Set { key, value },
StateChange::Delete { key } => state::StateChange::Delete { key },
}
