Skip to content

Commit

Permalink
clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Aug 26, 2024
1 parent 266b717 commit e21a5ae
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion contracts/examples/nft-minter/src/nft_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub trait NftModule {
) {
match result {
ManagedAsyncCallResult::Ok(token_id) => {
self.nft_token_id().set(&token_id.unwrap_esdt());
self.nft_token_id().set(token_id.unwrap_esdt());
},
ManagedAsyncCallResult::Err(_) => {
let returned = self.call_value().egld_or_single_esdt();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ pub trait ForwarderEsdtModule: fwd_storage_legacy::ForwarderStorageModule {
// so we can get the token identifier and amount from the call data
match result {
ManagedAsyncCallResult::Ok(()) => {
self.last_issued_token()
.set(&token_identifier.unwrap_esdt());
self.last_issued_token().set(token_identifier.unwrap_esdt());
self.last_error_message().clear();
},
ManagedAsyncCallResult::Err(message) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ pub trait ForwarderEsdtModule: fwd_storage::ForwarderStorageModule {
// so we can get the token identifier and amount from the call data
match result {
ManagedAsyncCallResult::Ok(()) => {
self.last_issued_token()
.set(&token_identifier.unwrap_esdt());
self.last_issued_token().set(token_identifier.unwrap_esdt());
self.last_error_message().clear();
},
ManagedAsyncCallResult::Err(message) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ pub trait LocalEsdtAndEsdtNft {
// so we can get the token identifier and amount from the call data
match result {
ManagedAsyncCallResult::Ok(()) => {
self.last_issued_token()
.set(&token_identifier.unwrap_esdt());
self.last_issued_token().set(token_identifier.unwrap_esdt());
self.last_error_message().clear();
},
ManagedAsyncCallResult::Err(message) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub trait Erc1155 {
self.token_owner(type_id, nft_id).set(to);
} else {
self.token_owner(type_id, nft_id)
.set(&ManagedAddress::zero());
.set(ManagedAddress::zero());
}
}

Expand Down Expand Up @@ -320,7 +320,7 @@ pub trait Erc1155 {
let amount = BigUint::from(1u32);
self.decrease_balance(owner, type_id, &amount);
self.token_owner(type_id, nft_id)
.set(&ManagedAddress::zero());
.set(ManagedAddress::zero());
}

/// Range is inclusive for both `start` and `end`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct StructWithManagedTypes<M: ManagedTypeApi> {
pub trait RustTestingFrameworkTester: dummy_module::DummyModule {
#[init]
fn init(&self) -> ManagedBuffer {
self.total_value().set(&BigUint::from(1u32));
self.total_value().set(BigUint::from(1u32));
b"constructor-result".into()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub trait ManagedVecItem: 'static {
/// - For items with Copy semantics, it should be the type itself.
/// - For managed types, ManagedRef does the job.
/// - For any other types, `Self` is currently used, although this is technically unsafe.
///
/// TODO: wrap other types in readonly wrapper.
type Ref<'a>: Borrow<Self>;

Expand Down

0 comments on commit e21a5ae

Please sign in to comment.