Skip to content

Commit

Permalink
Apply cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichi committed Jan 9, 2025
1 parent 96af1f8 commit af40961
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 23 deletions.
8 changes: 4 additions & 4 deletions crates/e2e/sandbox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ scale-info = { workspace = true }

[features]
default = [
# This is required for the runtime-interface to work properly in the std env.
"std",
# This is required for the runtime-interface to work properly in the std env.
"std",
]
std = [
"frame-support/std",
"frame-system/std",
"frame-metadata/std",
"ink_primitives/std",
"frame-metadata/std",
"ink_primitives/std",
"pallet-balances/std",
"pallet-revive/std",
"pallet-timestamp/std",
Expand Down
2 changes: 0 additions & 2 deletions crates/ink/ir/src/ir/item_impl/impl_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@ impl TryFrom<syn::ImplItem> for ImplItem {
match attr.first().kind() {
ir::AttributeArg::Message => {
<Message as TryFrom<_>>::try_from(fn_item)
.map(Into::into)
.map(Self::Message)
}
ir::AttributeArg::Constructor => {
<Constructor as TryFrom<_>>::try_from(fn_item)
.map(Into::into)
.map(Self::Constructor)
}
_ => Err(format_err_spanned!(
Expand Down
2 changes: 1 addition & 1 deletion crates/ink/tests/ui/contract/pass/example-erc20-works.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[ink::contract]
mod erc20 {
use ink_storage::Mapping;
use ink::H160;
use ink_storage::Mapping;

/// A simple ERC-20 contract.
#[ink(storage)]
Expand Down
20 changes: 4 additions & 16 deletions crates/ink/tests/ui/contract/pass/example-erc721-works.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[ink::contract]
mod erc721 {
use ink_storage::Mapping;
use ink::H160;
use ink_storage::Mapping;

/// A token ID.
pub type TokenId = u32;
Expand Down Expand Up @@ -117,11 +117,7 @@ mod erc721 {

/// Transfers the token from the caller to the given destination.
#[ink(message)]
pub fn transfer(
&mut self,
destination: H160,
id: TokenId,
) -> Result<(), Error> {
pub fn transfer(&mut self, destination: H160, id: TokenId) -> Result<(), Error> {
let caller = self.env().caller();
self.transfer_token_from(&caller, &destination, id)?;
Ok(())
Expand Down Expand Up @@ -209,11 +205,7 @@ mod erc721 {
}

/// Removes token `id` from the owner.
fn remove_token_from(
&mut self,
from: &H160,
id: TokenId,
) -> Result<(), Error> {
fn remove_token_from(&mut self, from: &H160, id: TokenId) -> Result<(), Error> {
let Self {
token_owner,
owned_tokens_count,
Expand Down Expand Up @@ -259,11 +251,7 @@ mod erc721 {
}

/// Approves or disapproves the operator to transfer all tokens of the caller.
fn approve_for_all(
&mut self,
to: H160,
approved: bool,
) -> Result<(), Error> {
fn approve_for_all(&mut self, to: H160, approved: bool) -> Result<(), Error> {
let caller = self.env().caller();
if to == caller {
return Err(Error::NotAllowed)
Expand Down

0 comments on commit af40961

Please sign in to comment.