Skip to content

Commit 25f06af

Browse files
authored
Appease rust 1.80 clippies (#1663)
Signed-off-by: Sean Young <[email protected]>
1 parent 06798cd commit 25f06af

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

src/codegen/polkadot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl RetCodeCheckBuilder<usize> {
9898

9999
impl RetCodeCheck {
100100
/// Handles all cases from the [RetBlock] accordingly.
101-
/// * On success, nothing is done and the execution continues at the success block.
101+
/// On success, nothing is done and the execution continues at the success block.
102102
/// If the callee reverted and output was supplied, it will be bubble up.
103103
/// Otherwise, a revert without data will be inserted.
104104
pub(crate) fn handle_cases(

src/codegen/statements/mod.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -1208,9 +1208,7 @@ pub fn process_side_effects_expressions(
12081208
}
12091209

12101210
ast::Expression::Builtin {
1211-
kind: builtin_type, ..
1212-
} => match &builtin_type {
1213-
ast::Builtin::PayableSend
1211+
kind: ast::Builtin::PayableSend
12141212
| ast::Builtin::ArrayPush
12151213
| ast::Builtin::ArrayPop
12161214
// PayableTransfer, Revert, Require and SelfDestruct do not occur inside an expression
@@ -1229,12 +1227,10 @@ pub fn process_side_effects_expressions(
12291227
| ast::Builtin::WriteUint64LE
12301228
| ast::Builtin::WriteUint128LE
12311229
| ast::Builtin::WriteUint256LE
1232-
| ast::Builtin::WriteAddress => {
1230+
| ast::Builtin::WriteAddress, ..
1231+
} => {
12331232
let _ = expression(exp, ctx.cfg, ctx.contract_no, ctx.func, ctx.ns, ctx.vartab, ctx.opt);
12341233
false
1235-
}
1236-
1237-
_ => true,
12381234
},
12391235

12401236
_ => true,

src/sema/ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ pub struct CallArgs {
12811281
/// This enum manages the accounts in an external call on Solana. There can be three options:
12821282
/// 1. The developer explicitly specifies there are not accounts for the call (`NoAccount`).
12831283
/// 2. The accounts call argument is absent, in which case we attempt to generate the AccountMetas
1284-
/// vector automatically (`AbsentArgumet`).
1284+
/// vector automatically (`AbsentArgumet`).
12851285
/// 3. There are accounts specified in the accounts call argument (Present).
12861286
#[derive(PartialEq, Eq, Clone, Debug, Default)]
12871287
pub enum ExternalCallAccounts<T> {

src/sema/external_functions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ fn check_statement(stmt: &Statement, call_list: &mut CallList) -> bool {
169169
}
170170
}
171171
}
172-
Statement::Return(_, exprs) => {
173-
for e in exprs {
172+
Statement::Return(_, expr) => {
173+
if let Some(e) = expr {
174174
e.recurse(call_list, check_expression);
175175
}
176176
}

tests/solana.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -917,9 +917,9 @@ fn sol_log_data(
917917
result
918918
);
919919

920-
print!(" {}", hex::encode(&event));
921-
922920
events.push(event.to_vec());
921+
922+
print!(" {}", hex::encode(event));
923923
}
924924

925925
println!();

0 commit comments

Comments
 (0)