Skip to content

Commit

Permalink
chore(clippy): make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
clearloop committed Nov 28, 2024
1 parent 506ed5b commit 71d4811
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion codegen/src/visitor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ macro_rules! map_wasm_operators {
};
}

impl<'a> VisitOperator<'a> for Function {
impl VisitOperator<'_> for Function {
type Output = Result<()>;

for_each_operator!(impl_visit_operator);
Expand Down
2 changes: 1 addition & 1 deletion codegen/src/wasm/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl<'f> Deref for Functions<'f> {
}
}

impl<'f> DerefMut for Functions<'f> {
impl DerefMut for Functions<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
Expand Down
22 changes: 11 additions & 11 deletions examples/erc20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,17 @@ fn deploy() -> anyhow::Result<()> {

// TODO: refactor offset handling (#280)
// 6. check approval
// let value = 42;
// let spender = [42; 20];
// let info = evm
// .calldata(&contract.encode(&[
// b"approve(address,uint256)".to_vec(),
// spender.to_bytes32().to_vec(),
// value.to_bytes32().to_vec(),
// ])?)
// .call(address)?;
// assert_eq!(info.ret, true.to_bytes32(), "{info:?}");
//
let value = 42;
let spender = [42; 20];
let info = evm
.calldata(&contract.encode(&[
b"approve(address,uint256)".to_vec(),
spender.to_bytes32().to_vec(),
value.to_bytes32().to_vec(),
])?)
.call(address)?;
assert_eq!(info.ret, true.to_bytes32(), "{info:?}");

// let allowance = evm.storage(
// address,
// Allowance::storage_key(Address(evm.caller), Address(spender)),
Expand Down
2 changes: 1 addition & 1 deletion zint/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl<'e> Default for EVM<'e> {
}
}

impl<'e> EVM<'e> {
impl EVM<'_> {
/// Interpret runtime bytecode with provided arguments
pub fn interp(runtime_bytecode: &[u8], input: &[u8]) -> Result<Info> {
Self::default()
Expand Down

0 comments on commit 71d4811

Please sign in to comment.