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

Appease rust 1.80 clippies #1663

Merged
merged 1 commit into from
Aug 21, 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 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
4 changes: 2 additions & 2 deletions src/sema/external_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ fn check_statement(stmt: &Statement, call_list: &mut CallList) -> bool {
}
}
}
Statement::Return(_, exprs) => {
for e in exprs {
Statement::Return(_, expr) => {
if let Some(e) = expr {
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
Loading