Skip to content

Commit

Permalink
Appease rust 1.80 clippies
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Young <[email protected]>
  • Loading branch information
seanyoung committed Aug 19, 2024
1 parent 06798cd commit 9a357ff
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/codegen/polkadot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl RetCodeCheckBuilder<usize> {

impl RetCodeCheck {
/// Handles all cases from the [RetBlock] accordingly.
/// * On success, nothing is done and the execution continues at the success block.
/// On success, nothing is done and the execution continues at the success block.
/// If the callee reverted and output was supplied, it will be bubble up.
/// Otherwise, a revert without data will be inserted.
pub(crate) fn handle_cases(
Expand Down
10 changes: 3 additions & 7 deletions src/codegen/statements/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1208,9 +1208,7 @@ pub fn process_side_effects_expressions(
}

ast::Expression::Builtin {
kind: builtin_type, ..
} => match &builtin_type {
ast::Builtin::PayableSend
kind: ast::Builtin::PayableSend
| ast::Builtin::ArrayPush
| ast::Builtin::ArrayPop
// PayableTransfer, Revert, Require and SelfDestruct do not occur inside an expression
Expand All @@ -1229,12 +1227,10 @@ pub fn process_side_effects_expressions(
| ast::Builtin::WriteUint64LE
| ast::Builtin::WriteUint128LE
| ast::Builtin::WriteUint256LE
| ast::Builtin::WriteAddress => {
| ast::Builtin::WriteAddress, ..
} => {
let _ = expression(exp, ctx.cfg, ctx.contract_no, ctx.func, ctx.ns, ctx.vartab, ctx.opt);
false
}

_ => true,
},

_ => true,
Expand Down
2 changes: 1 addition & 1 deletion src/sema/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ pub struct CallArgs {
/// This enum manages the accounts in an external call on Solana. There can be three options:
/// 1. The developer explicitly specifies there are not accounts for the call (`NoAccount`).
/// 2. The accounts call argument is absent, in which case we attempt to generate the AccountMetas
/// vector automatically (`AbsentArgumet`).
/// vector automatically (`AbsentArgumet`).
/// 3. There are accounts specified in the accounts call argument (Present).
#[derive(PartialEq, Eq, Clone, Debug, Default)]
pub enum ExternalCallAccounts<T> {
Expand Down
2 changes: 1 addition & 1 deletion src/sema/external_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ fn check_statement(stmt: &Statement, call_list: &mut CallList) -> bool {
}
}
Statement::Return(_, exprs) => {
for e in exprs {
while let Some(e) = exprs {
e.recurse(call_list, check_expression);
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,9 +917,9 @@ fn sol_log_data(
result
);

print!(" {}", hex::encode(&event));

events.push(event.to_vec());

print!(" {}", hex::encode(event));
}

println!();
Expand Down

0 comments on commit 9a357ff

Please sign in to comment.