Skip to content

Commit

Permalink
Fix fresh clippy lints (hyperledger-solang#1621)
Browse files Browse the repository at this point in the history
  • Loading branch information
xermicus authored Jan 31, 2024
1 parent 0f032dc commit b6b2fc9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/codegen/array_boundary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub(crate) fn handle_array_assign(
cfg.array_lengths_temps.insert(pos, to_update);
} else {
// If the right hand side doesn't have a temp, it must be a function parameter or a struct member.
cfg.array_lengths_temps.remove(&pos);
cfg.array_lengths_temps.swap_remove(&pos);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/reaching_definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ pub fn apply_transfers(transfers: &[Transfer], vars: &mut IndexMap<usize, IndexM
for transfer in transfers {
match transfer {
Transfer::Kill { var_no } => {
vars.remove(var_no);
vars.swap_remove(var_no);
}
Transfer::Mod { var_no } => {
if let Some(entry) = vars.get_mut(var_no) {
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/vector_to_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fn apply_transfers(
for transfer in transfers {
match transfer {
Transfer::Kill { var_no } => {
vars.remove(var_no);
vars.swap_remove(var_no);
}
Transfer::Mod { var_no } => {
if let Some(entry) = vars.get_mut(var_no) {
Expand Down
6 changes: 3 additions & 3 deletions tests/lir_tests/convert_lir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn print_lir_str(src: &str, cfg_no: usize, target: Target) {
ns.print_diagnostics_in_plain(&resolver, false);
}
codegen(&mut ns, &Default::default());
let contract = ns.contracts.get(0).unwrap();
let contract = ns.contracts.first().unwrap();
let cfg = contract.cfg.get(cfg_no).unwrap();

let converter = Converter::new(&ns, cfg);
Expand All @@ -47,7 +47,7 @@ fn assert_lir_str_eq_by_name(src: &str, cfg_name: &str, expected: &str, target:
ns.print_diagnostics_in_plain(&resolver, false);
}
codegen(&mut ns, &Default::default());
let contract = ns.contracts.get(0).unwrap();
let contract = ns.contracts.first().unwrap();
let cfg = contract
.cfg
.iter()
Expand Down Expand Up @@ -84,7 +84,7 @@ fn assert_lir_str_eq(src: &str, cfg_no: usize, expected: &str, target: Target) {
ns.print_diagnostics_in_plain(&resolver, false);
}
codegen(&mut ns, &Default::default());
let contract = ns.contracts.get(0).unwrap();
let contract = ns.contracts.first().unwrap();
let cfg = contract.cfg.get(cfg_no).unwrap();

let converter = Converter::new(&ns, cfg);
Expand Down

0 comments on commit b6b2fc9

Please sign in to comment.