Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy fix #1746

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading