From 2ff02e0be5611b5f2e92bb0ce069b63cc00e5939 Mon Sep 17 00:00:00 2001 From: francois Date: Fri, 26 Apr 2024 15:31:13 +0200 Subject: [PATCH] happy clippy --- x/programs/rust/examples/counter/src/lib.rs | 4 ++-- x/programs/rust/examples/token/src/lib.rs | 8 ++++---- x/programs/rust/wasmlanche-sdk/src/state.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x/programs/rust/examples/counter/src/lib.rs b/x/programs/rust/examples/counter/src/lib.rs index fa366541cd..2b8abd9c6a 100644 --- a/x/programs/rust/examples/counter/src/lib.rs +++ b/x/programs/rust/examples/counter/src/lib.rs @@ -21,7 +21,7 @@ pub fn initialize_address(context: Context, address: Address) -> bool { program .state() - .store(StateKeys::Counter(address), &0_i64) + .store(StateKeys::Counter(address), 0_i64) .expect("failed to store counter"); true @@ -35,7 +35,7 @@ pub fn inc(context: Context, to: Address, amount: i64) -> bool { program .state() - .store(StateKeys::Counter(to), &counter) + .store(StateKeys::Counter(to), counter) .expect("failed to store counter"); true diff --git a/x/programs/rust/examples/token/src/lib.rs b/x/programs/rust/examples/token/src/lib.rs index e523308554..af52baf314 100644 --- a/x/programs/rust/examples/token/src/lib.rs +++ b/x/programs/rust/examples/token/src/lib.rs @@ -25,7 +25,7 @@ pub fn init(context: Context) -> bool { // set total supply program .state() - .store(StateKey::TotalSupply, &INITIAL_SUPPLY) + .store(StateKey::TotalSupply, INITIAL_SUPPLY) .expect("failed to store total supply"); // set token name @@ -64,7 +64,7 @@ pub fn mint_to(context: Context, recipient: Address, amount: i64) -> bool { program .state() - .store(StateKey::Balance(recipient), &(balance + amount)) + .store(StateKey::Balance(recipient), balance + amount) .expect("failed to store balance"); true @@ -103,12 +103,12 @@ pub fn transfer(context: Context, sender: Address, recipient: Address, amount: i // update balances program .state() - .store(StateKey::Balance(sender), &(sender_balance - amount)) + .store(StateKey::Balance(sender), sender_balance - amount) .expect("failed to store balance"); program .state() - .store(StateKey::Balance(recipient), &(recipient_balance + amount)) + .store(StateKey::Balance(recipient), recipient_balance + amount) .expect("failed to store balance"); true diff --git a/x/programs/rust/wasmlanche-sdk/src/state.rs b/x/programs/rust/wasmlanche-sdk/src/state.rs index f2e4fafd81..82111e3dd3 100644 --- a/x/programs/rust/wasmlanche-sdk/src/state.rs +++ b/x/programs/rust/wasmlanche-sdk/src/state.rs @@ -116,7 +116,7 @@ where self.cache.entry(key).or_insert(bytes) }; - from_slice::(&val_bytes).map_err(|_| StateError::Deserialization) + from_slice::(val_bytes).map_err(|_| StateError::Deserialization) } /// Delete a value from the hosts's storage.