Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
plotchy committed Jun 26, 2024
1 parent 4e5c40a commit e20f73d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
39 changes: 18 additions & 21 deletions crates/analyzers/src/bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,28 +86,25 @@ impl OrderedAnalysis {
set.insert(init.into());
analyses.insert(source, set);
}
ba.bound_changes
.iter()
.for_each(|bound_change| {
let (parts, unsat) =
range_parts(analyzer, arena, &ba.report_config, &bound_change.1);
let item = StrippedAnalysisItem {
init: false,
name: ba.var_display_name.clone(),
loc: LocSpan(bound_change.0 .1),
order: (bound_change.0.end() - bound_change.0.start()) as i32, //i as i32,
// storage: ba.storage.clone(),
ctx: ba.ctx,
ctx_conditionals: ba.conditionals(analyzer, arena),
parts,
unsat,
};
ba.bound_changes.iter().for_each(|bound_change| {
let (parts, unsat) = range_parts(analyzer, arena, &ba.report_config, &bound_change.1);
let item = StrippedAnalysisItem {
init: false,
name: ba.var_display_name.clone(),
loc: LocSpan(bound_change.0 .1),
order: (bound_change.0.end() - bound_change.0.start()) as i32, //i as i32,
// storage: ba.storage.clone(),
ctx: ba.ctx,
ctx_conditionals: ba.conditionals(analyzer, arena),
parts,
unsat,
};

let entry = analyses
.entry(*LocSpan(bound_change.0 .1).source())
.or_default();
entry.insert(item);
});
let entry = analyses
.entry(*LocSpan(bound_change.0 .1).source())
.or_default();
entry.insert(item);
});
Self { analyses }
}

Expand Down
4 changes: 2 additions & 2 deletions crates/graph/src/range/elem/map_or_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ impl RangeElem<Concrete> for RangeDyn<Concrete> {
.map(|(k, (v, op))| {
let mut new_k = k.clone();
let mut new_v = v.clone();
let _ =new_k.arenaize(analyzer, arena);
let _ =new_v.arenaize(analyzer, arena);
let _ = new_k.arenaize(analyzer, arena);
let _ = new_v.arenaize(analyzer, arena);
(new_k, (new_v, *op))
})
.collect();
Expand Down
23 changes: 13 additions & 10 deletions crates/pyrometer/src/graph_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ impl Elems {
existing_node_idx
} else {
// make a new ContextVar Node for the Arena graph
let new_node_idx = graph.add_node(ArenaNode::CVAR(dep_elem.as_dot_str(graph_backend, arena).to_string()));
let new_node_idx = graph.add_node(ArenaNode::CVAR(
dep_elem.as_dot_str(graph_backend, arena).to_string(),
));
dependency_map.insert(dep_elem, new_node_idx);
new_node_idx
};
Expand All @@ -299,12 +301,12 @@ impl Elems {
}
Elem::ConcreteDyn(_range_dyn) => {
let node_str = elem.arena_graph_node_label();

graph.add_node(ArenaNode::ELEM(node_str))
}
Elem::Concrete(_range_concrete) => {
let node_str = elem.arena_graph_node_label();

graph.add_node(ArenaNode::ELEM(node_str))
}
Elem::Expr(range_expr) => {
Expand All @@ -329,7 +331,9 @@ impl Elems {
existing_node_idx
} else {
// make a new ContextVar Node for the Arena graph
let new_node_idx = graph.add_node(ArenaNode::CVAR(dep_elem.as_dot_str(graph_backend, arena).to_string()));
let new_node_idx = graph.add_node(ArenaNode::CVAR(
dep_elem.as_dot_str(graph_backend, arena).to_string(),
));
dependency_map.insert(*dep_elem, new_node_idx);
new_node_idx
};
Expand Down Expand Up @@ -360,7 +364,9 @@ impl Elems {
existing_node_idx
} else {
// make a new ContextVar Node for the Arena graph
let new_node_idx = graph.add_node(ArenaNode::CVAR(dep_elem.as_dot_str(graph_backend, arena).to_string()));
let new_node_idx = graph.add_node(ArenaNode::CVAR(
dep_elem.as_dot_str(graph_backend, arena).to_string(),
));
dependency_map.insert(*dep_elem, new_node_idx);
new_node_idx
};
Expand Down Expand Up @@ -394,7 +400,7 @@ impl Elems {
}
Elem::Null => {
let node_str = "null".to_string();

graph.add_node(ArenaNode::ELEM(node_str))
}
};
Expand Down Expand Up @@ -505,10 +511,7 @@ flowchart TB

let nodes_str = graph
.node_indices()
.map(|idx| {

arena_mermaid_node(graph, "\t", idx, true, true, None)
})
.map(|idx| arena_mermaid_node(graph, "\t", idx, true, true, None))
.collect::<Vec<_>>()
.join("\n");

Expand Down

0 comments on commit e20f73d

Please sign in to comment.