From 98ad72ecd98fa1fa25c60736d9cbd2a3211007d8 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 3 Jul 2019 18:06:35 +0100 Subject: [PATCH] rust: implement Default for evmc_address/evmc_bytes32 Same as with PartialEq: this may be done via bindgen in the future. --- bindings/rust/evmc-sys/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bindings/rust/evmc-sys/src/lib.rs b/bindings/rust/evmc-sys/src/lib.rs index 012e1f5..bff096d 100644 --- a/bindings/rust/evmc-sys/src/lib.rs +++ b/bindings/rust/evmc-sys/src/lib.rs @@ -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] } + } +}