Skip to content

Commit

Permalink
chore: fix warnings in avm-transpiler (#8307)
Browse files Browse the repository at this point in the history
This PR fixes clippy issues from the avm-transpiler crate.
  • Loading branch information
TomAFrench authored Aug 31, 2024
1 parent 104ea85 commit 359fe05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions avm-transpiler/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn main() {

// Parse original (pre-transpile) contract.
let contract_json = fs::read_to_string(Path::new(in_contract_artifact_path))
.expect(&format!("Unable to read file: {in_contract_artifact_path}"));
.unwrap_or_else(|_| panic!("Unable to read file: {in_contract_artifact_path}"));
let raw_json_obj: serde_json::Value =
serde_json::from_str(&contract_json).expect(&json_parse_error);

Expand All @@ -44,7 +44,7 @@ fn main() {
Path::new(out_transpiled_artifact_path),
Path::new(&(out_transpiled_artifact_path.clone() + ".bak")),
)
.expect(&format!("Unable to backup file: {out_transpiled_artifact_path}"));
.unwrap_or_else(|_| panic!("Unable to backup file: {out_transpiled_artifact_path}"));
}

// Parse json into contract object
Expand Down
2 changes: 1 addition & 1 deletion avm-transpiler/src/transpile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ fn handle_storage_write(
inputs: &Vec<ValueOrArray>,
) {
assert!(inputs.len() == 2);
assert!(destinations.len() == 0);
assert!(destinations.is_empty());

let slot_offset_maybe = inputs[0];
let slot_offset = match slot_offset_maybe {
Expand Down

0 comments on commit 359fe05

Please sign in to comment.