Skip to content

Commit

Permalink
happy clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
iFrostizz committed Apr 26, 2024
1 parent 04ec581 commit 2ff02e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions x/programs/rust/examples/counter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions x/programs/rust/examples/token/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x/programs/rust/wasmlanche-sdk/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ where
self.cache.entry(key).or_insert(bytes)
};

from_slice::<V>(&val_bytes).map_err(|_| StateError::Deserialization)
from_slice::<V>(val_bytes).map_err(|_| StateError::Deserialization)
}

/// Delete a value from the hosts's storage.
Expand Down

0 comments on commit 2ff02e0

Please sign in to comment.