Skip to content

Commit

Permalink
rust: implement Default for evmc_address/evmc_bytes32
Browse files Browse the repository at this point in the history
Same as with PartialEq: this may be done via bindgen in the future.
  • Loading branch information
axic committed Jul 3, 2019
1 parent b52a3dc commit 98ad72e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bindings/rust/evmc-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,15 @@ impl PartialEq for evmc_bytes32 {
self.bytes == other.bytes
}
}

impl Default for evmc_address {
fn default() -> Self {
evmc_address { bytes: [0u8; 20] }
}
}

impl Default for evmc_bytes32 {
fn default() -> Self {
evmc_bytes32 { bytes: [0u8; 32] }
}
}

0 comments on commit 98ad72e

Please sign in to comment.