From 6c4efc63534b4b3260b118ed9f0babb7c3711739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20M=2E=20Gonz=C3=A1lez?= Date: Fri, 27 Oct 2023 19:38:33 -0300 Subject: [PATCH] Passed through clippy. --- crates/env/src/api.rs | 4 ++-- crates/env/src/backend.rs | 2 +- crates/env/src/engine/off_chain/impls.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/env/src/api.rs b/crates/env/src/api.rs index 43636050ee0..f4d6bd257fa 100644 --- a/crates/env/src/api.rs +++ b/crates/env/src/api.rs @@ -211,7 +211,7 @@ where V: Storable, Ref: ink_storage_traits::StorageLayout, { - let x = Ref::layout as u64; + let x = Ref::layout as usize; let x = ((x | (x >> 32)) & 0xFFFFFFFF) as u32; set_contract_storage(&x, value) } @@ -466,7 +466,7 @@ where /// When the test_instantiate feature is used, the contract is allowed to /// return normally. This feature should only be used for integration tests. #[cfg(feature = "test_instantiate")] -pub fn return_value(return_flags: ReturnFlags, return_value: &R) -> () +pub fn return_value(return_flags: ReturnFlags, return_value: &R) where R: scale::Encode, { diff --git a/crates/env/src/backend.rs b/crates/env/src/backend.rs index 1d0f5fddab5..9301f304231 100644 --- a/crates/env/src/backend.rs +++ b/crates/env/src/backend.rs @@ -262,7 +262,7 @@ pub trait EnvBackend { /// The `flags` parameter can be used to revert the state changes of the /// entire execution if necessary. #[cfg(feature = "test_instantiate")] - fn return_value(&mut self, flags: ReturnFlags, return_value: &R) -> () + fn return_value(&mut self, flags: ReturnFlags, return_value: &R) where R: scale::Encode; diff --git a/crates/env/src/engine/off_chain/impls.rs b/crates/env/src/engine/off_chain/impls.rs index ba56fbd4b60..c19d67881dc 100644 --- a/crates/env/src/engine/off_chain/impls.rs +++ b/crates/env/src/engine/off_chain/impls.rs @@ -260,7 +260,7 @@ impl EnvBackend for EnvInstance { } #[cfg(feature = "test_instantiate")] - fn return_value(&mut self, _flags: ReturnFlags, return_value: &R) -> () + fn return_value(&mut self, _flags: ReturnFlags, return_value: &R) where R: scale::Encode, {