Skip to content

Commit

Permalink
clippy manual
Browse files Browse the repository at this point in the history
  • Loading branch information
alexroan committed May 8, 2024
1 parent c3ba845 commit b135739
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions aderyn_core/src/detect/high/unsafe_casting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,18 @@ fn has_binary_operation_checks(
contract: Option<&ASTNode>,
identifier_reference_declaration_id: &NodeID,
) -> bool {
if let Some(contract) = contract {
if let ASTNode::ContractDefinition(contract) = contract {
return ExtractBinaryOperations::from(contract)
.extracted
.iter()
.any(|binary_operation| {
ExtractIdentifiers::from(binary_operation)
.extracted
.into_iter()
.any(|identifier| {
identifier.referenced_declaration
== *identifier_reference_declaration_id
})
});
}
if let Some(ASTNode::ContractDefinition(contract)) = contract {
return ExtractBinaryOperations::from(contract)
.extracted
.iter()
.any(|binary_operation| {
ExtractIdentifiers::from(binary_operation)
.extracted
.into_iter()
.any(|identifier| {
identifier.referenced_declaration == *identifier_reference_declaration_id
})
});
}
false
}
Expand Down

0 comments on commit b135739

Please sign in to comment.