Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
brockelmore committed Mar 19, 2024
1 parent 6c51283 commit e6173b0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion crates/graph/src/range/elem/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl RangeExpr<Concrete> {
(false, 0)
}
}
_ => (false, 0),
_ => (false, 0),
}
}

Expand Down
3 changes: 1 addition & 2 deletions crates/graph/src/solvers/atoms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ pub trait Atomize {
impl Atomize for Elem<Concrete> {
#[tracing::instrument(level = "trace", skip_all)]
fn atoms_or_part(&self, analyzer: &mut impl GraphBackend) -> AtomOrPart {

match self {
Elem::Arena(_) => self.dearenaize(analyzer).borrow().atoms_or_part(analyzer),
Elem::Concrete(_) | Elem::Reference(_) => AtomOrPart::Part(self.clone()),
Expand All @@ -273,7 +272,7 @@ impl Atomize for Elem<Concrete> {

match (
expr.lhs.atoms_or_part(analyzer),
expr.rhs.atoms_or_part(analyzer)
expr.rhs.atoms_or_part(analyzer),
) {
(ref lp @ AtomOrPart::Part(ref l), ref rp @ AtomOrPart::Part(ref r)) => {
// println!("part part");
Expand Down
29 changes: 22 additions & 7 deletions crates/graph/src/solvers/dl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,16 @@ impl DLSolver {
let basic: Vec<SolverAtom> = dl_solvable
.iter()
.filter_map(|var| {
let res: Vec<_> = var.iter().filter_map(|constraint| {
if constraint.len() == 1 { Some(constraint.clone()) } else { None }
}).collect();
let res: Vec<_> = var
.iter()
.filter_map(|constraint| {
if constraint.len() == 1 {
Some(constraint.clone())
} else {
None
}
})
.collect();
if res.len() == 1 {
Some(res)
} else {
Expand All @@ -345,9 +352,16 @@ impl DLSolver {
let multi: Vec<_> = dl_solvable
.iter()
.filter_map(|var| {
let res: Vec<_> = var.iter().filter_map(|constraint| {
if constraint.len() > 1 { Some(constraint.clone()) } else { None }
}).collect();
let res: Vec<_> = var
.iter()
.filter_map(|constraint| {
if constraint.len() > 1 {
Some(constraint.clone())
} else {
None
}
})
.collect();
if res.len() > 1 {
Some(res)
} else {
Expand Down Expand Up @@ -780,7 +794,8 @@ impl DLSolver {
RangeOp::Lt => {
// x < y
// x <= y - 1
let new_rhs = constraint.rhs
let new_rhs = constraint
.rhs
.into_elem()
.wrapping_sub(Elem::from(Concrete::from(U256::one())))
.atoms_or_part(analyzer);
Expand Down

0 comments on commit e6173b0

Please sign in to comment.