Skip to content

Commit

Permalink
Use destructuring for GasReport conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
chipshort committed Aug 16, 2023
1 parent ea1c5c8 commit b267953
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions libwasmvm/src/gas_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ pub struct GasReport {
}

impl From<cosmwasm_vm::GasReport> for GasReport {
fn from(value: cosmwasm_vm::GasReport) -> Self {
fn from(
cosmwasm_vm::GasReport {
limit,
remaining,
used_externally,
used_internally,
}: cosmwasm_vm::GasReport,
) -> Self {
Self {
limit: value.limit,
remaining: value.remaining,
used_externally: value.used_externally,
used_internally: value.used_internally,
limit,
remaining,
used_externally,
used_internally,
}
}
}

0 comments on commit b267953

Please sign in to comment.