Skip to content

Commit

Permalink
Update .is_constructor -> .kind() == &FunctionKind::Constructor f…
Browse files Browse the repository at this point in the history
…or broader version compatiblity (#773)
  • Loading branch information
TilakMaddy authored Oct 18, 2024
1 parent ab2eecc commit 1acd400
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions aderyn_core/src/detect/high/multiple_constructors.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::BTreeMap, error::Error};

use crate::ast::NodeID;
use crate::ast::{FunctionKind, NodeID};

use crate::{
capture,
Expand All @@ -25,7 +25,7 @@ impl IssueDetector for MultipleConstructorsDetector {
ExtractFunctionDefinitions::from(contract)
.extracted
.iter()
.filter(|function| function.is_constructor)
.filter(|function| function.kind() == &FunctionKind::Constructor)
.count()
> 1
})
Expand Down
4 changes: 2 additions & 2 deletions aderyn_core/src/detect/low/dead_code.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::BTreeMap, error::Error};

use crate::ast::{ASTNode, ContractKind, NodeID, NodeType, Visibility};
use crate::ast::{ASTNode, ContractKind, FunctionKind, NodeID, NodeType, Visibility};

use crate::{
capture,
Expand Down Expand Up @@ -34,7 +34,7 @@ impl IssueDetector for DeadCodeDetector {
f.overrides.is_none()
&& f.implemented
&& f.visibility == Visibility::Internal
&& !f.is_constructor
&& f.kind() != &FunctionKind::Constructor
})
.filter(|&f| {
if let Some(ASTNode::ContractDefinition(contract)) =
Expand Down

0 comments on commit 1acd400

Please sign in to comment.