Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
brockelmore committed Jul 12, 2024
1 parent b4855ed commit e31cd0b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion crates/graph/src/nodes/context/variables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ impl ContextNode {
fields.iter().try_for_each(|field| {
self.recursive_move_struct_field(new_cvarnode, *field, loc, analyzer)
})?;
Ok(new_cvarnode.into())
Ok(new_cvarnode)
} else {
Ok(var)
}
Expand Down
12 changes: 6 additions & 6 deletions crates/graph/src/solvers/atoms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ impl Atomize for Elem<Concrete> {
match self {
Elem::Arena(_) => {
self.dearenaize_clone(arena)
.atoms_or_part(Some(&self), analyzer, arena)
.atoms_or_part(Some(self), analyzer, arena)
}
Elem::Concrete(_) | Elem::Reference(_) => AtomOrPart::Part(self.clone()),
Elem::ConcreteDyn(_) => AtomOrPart::Part(self.clone()),
Expand All @@ -311,17 +311,17 @@ impl Atomize for Elem<Concrete> {
match collapse(*expr.lhs.clone(), expr.op, *expr.rhs.clone(), arena) {
MaybeCollapsed::Concretes(_l, _r) => {
let exec_res = expr.exec_op(true, analyzer, arena).unwrap();
return exec_res.atoms_or_part(Some(&self), analyzer, arena);
return exec_res.atoms_or_part(Some(self), analyzer, arena);
}
MaybeCollapsed::Collapsed(elem) => {
return elem.atoms_or_part(Some(&self), analyzer, arena);
return elem.atoms_or_part(Some(self), analyzer, arena);
}
MaybeCollapsed::Not(..) => {}
}

match (
expr.lhs.atoms_or_part(Some(&self), analyzer, arena),
expr.rhs.atoms_or_part(Some(&self), analyzer, arena),
expr.lhs.atoms_or_part(Some(self), analyzer, arena),
expr.rhs.atoms_or_part(Some(self), analyzer, arena),
) {
(ref lp @ AtomOrPart::Part(ref l), ref rp @ AtomOrPart::Part(ref r)) => {
// println!("part part");
Expand Down Expand Up @@ -373,7 +373,7 @@ impl Atomize for Elem<Concrete> {
if res == Elem::Expr(expr.clone()) {
AtomOrPart::Part(res)
} else {
res.atoms_or_part(Some(&self), analyzer, arena)
res.atoms_or_part(Some(self), analyzer, arena)
}
}
(Elem::ConcreteDyn(_), _) => AtomOrPart::Part(Elem::Null),
Expand Down
2 changes: 1 addition & 1 deletion crates/solc-expressions/src/assign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{array::Array, variable::Variable, ContextBuilder, ExpressionParser,
use graph::{
elem::{Elem, RangeElem},
nodes::{Concrete, ContextNode, ContextVarNode, ExprRet},
AnalyzerBackend, ContextEdge, Edge, Node,
AnalyzerBackend, ContextEdge, Edge,
};

use shared::{ExprErr, GraphError, IntoExprErr, RangeArena};
Expand Down
3 changes: 1 addition & 2 deletions crates/solc-expressions/src/func_call/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,7 @@ pub trait CallerHelper: AnalyzerBackend<Expr = Expression, ExprErr = ExprErr> +
.into_iter()
.map(|i| (i, new_in_inheritor))
.collect::<Vec<_>>();
while !struct_stack.is_empty() {
let (field, parent) = struct_stack.pop().unwrap();
while let Some((field, parent)) = struct_stack.pop() {
let underlying =
field.underlying(analyzer).into_expr_err(loc)?;
let new_field_in_inheritor =
Expand Down
6 changes: 2 additions & 4 deletions crates/solc-expressions/src/variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,7 @@ pub trait Variable: AnalyzerBackend<Expr = Expression, ExprErr = ExprErr> + Size
.into_iter()
.map(|i| (i, new_cvarnode))
.collect::<Vec<_>>();
while !struct_stack.is_empty() {
let (field, parent) = struct_stack.pop().unwrap();
while let Some((field, parent)) = struct_stack.pop() {
let underlying = field.underlying(self).into_expr_err(loc)?;
let new_field_in_inheritor =
self.add_node(Node::ContextVar(underlying.clone()));
Expand Down Expand Up @@ -665,8 +664,7 @@ pub trait Variable: AnalyzerBackend<Expr = Expression, ExprErr = ExprErr> + Size
.into_iter()
.map(|i| (i, new_cvarnode))
.collect::<Vec<_>>();
while !struct_stack.is_empty() {
let (field, parent) = struct_stack.pop().unwrap();
while let Some((field, parent)) = struct_stack.pop() {
let underlying = field.underlying(self).into_expr_err(loc)?;
let new_field_in_inheritor =
self.add_node(Node::ContextVar(underlying.clone()));
Expand Down

0 comments on commit e31cd0b

Please sign in to comment.