Skip to content

Commit

Permalink
Explain manual drop with comment in code
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinquaXD committed Apr 22, 2024
1 parent 5e78a27 commit 9a3ff41
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ethcontract-common/src/artifact/hardhat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ impl HardHatLoader {

existing_contract
} else {
// `Drop` of the contract guard can update the underlying contract which can lead
// to borrowing issues. To work around those we manually drop the guard here.
drop(contract_guard);
artifact.insert(contract).inserted_contract
};
Expand Down

0 comments on commit 9a3ff41

Please sign in to comment.