Skip to content

Commit 978c58a

Browse files
authored
build(deps): bump dependencies to latest version (#15)
* build(deps): update dependencies Signed-off-by: Luca Georges Francois <luca@quartz.technology> * fix: update scanners to reflect dependencies bump Signed-off-by: Luca Georges Francois <luca@quartz.technology> --------- Signed-off-by: Luca Georges Francois <luca@quartz.technology>
1 parent b70d082 commit 978c58a

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ categories = ["command-line-utilities", "development-tools"]
1414
[dependencies]
1515
anyhow = "1.0.72"
1616
clap = { version = "4", features = ["derive"] }
17-
syn-solidity = "0.3.0"
17+
syn-solidity = "0.4.2"
1818
syn = { version = "2.0.26", features = ["full"] }
1919
proc-macro2 = { version = "1.0.65", features = ["span-locations"]}
2020
colored = "2.0.4"

src/scanners/implementations/missing_comments.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
use syn_solidity::{
2-
Item, ItemContract, ItemEnum, ItemError, ItemEvent, ItemFunction, ItemStruct, ItemUdt,
3-
};
1+
use syn_solidity::{Item, ItemContract, ItemEnum, ItemError, ItemEvent, ItemFunction, ItemStruct, ItemUdt, Spanned};
42

53
use crate::scanners::{
64
result::{Reporter, Severity},

src/scanners/implementations/mutable_functions.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::scanners::{
22
result::{Reporter, Severity},
33
Scanner,
44
};
5-
use syn_solidity::{FunctionAttribute, Item, ItemContract, ItemFunction, Mutability};
5+
use syn_solidity::{FunctionAttribute, Item, ItemContract, ItemFunction, Mutability, Spanned};
66

77
#[derive(Default)]
88
pub struct MutableFunctions {}
@@ -19,8 +19,7 @@ impl MutableFunctions {
1919

2020
/// Reports if a function is able to mutate the contract state.
2121
fn scan_function(&self, function: &ItemFunction, reporter: &mut Reporter) {
22-
// TODO: There is probably a cleaner way to check this.
23-
if function.kind.as_str() == "modifier" {
22+
if function.kind.is_modifier() {
2423
return;
2524
}
2625

@@ -31,7 +30,7 @@ impl MutableFunctions {
3130
];
3231

3332
for ifa in immutable_function_attributes {
34-
if function.attributes.get(ifa).is_some() {
33+
if function.attributes.contains(ifa) {
3534
return;
3635
}
3736
}

src/scanners/implementations/mutable_variables.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::scanners::{
22
result::{Reporter, Severity},
33
Scanner,
44
};
5-
use syn_solidity::{Item, ItemContract, VariableAttribute, VariableDefinition};
5+
use syn_solidity::{Item, ItemContract, Spanned, VariableAttribute, VariableDefinition};
66

77
#[derive(Default)]
88
pub struct MutableVariables {}
@@ -25,7 +25,7 @@ impl MutableVariables {
2525
];
2626

2727
for iva in immutable_variable_attributes {
28-
if variable.attributes.0.get(iva).is_some() {
28+
if variable.attributes.0.contains(iva) {
2929
return;
3030
}
3131
}

tests/contracts/SimpleContract.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ error BrokenQuartz();
66

77
enum QuartzType {
88
Amethyst,
9-
Agate,
9+
Agate
1010
}
1111

1212
struct Quartz {

0 commit comments

Comments
 (0)