From bf5aa5a990f44fe855982ede1e9b05fc2ce28e06 Mon Sep 17 00:00:00 2001 From: brock elmore Date: Wed, 10 Jul 2024 15:42:39 -0700 Subject: [PATCH] lint --- crates/graph/src/solvers/dl.rs | 6 +++--- crates/pyrometer/src/graph_backend.rs | 4 ++-- crates/solc-expressions/src/literal.rs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/graph/src/solvers/dl.rs b/crates/graph/src/solvers/dl.rs index 443d0a3d..df850525 100644 --- a/crates/graph/src/solvers/dl.rs +++ b/crates/graph/src/solvers/dl.rs @@ -570,10 +570,10 @@ impl DLSolver { added_atoms.push((*dyn_elem).clone()); self.graph_map.insert((*dyn_elem).clone(), idx); if let Some(dep) = dep { - if !self.var_to_atom_idx.contains_key(&dep) { + self.var_to_atom_idx.entry(dep).or_insert_with(|| { added_deps.push(dep); - self.var_to_atom_idx.insert(dep, idx); - } + idx + }); } idx }; diff --git a/crates/pyrometer/src/graph_backend.rs b/crates/pyrometer/src/graph_backend.rs index 8fd62682..1f3a7523 100644 --- a/crates/pyrometer/src/graph_backend.rs +++ b/crates/pyrometer/src/graph_backend.rs @@ -572,10 +572,10 @@ pub fn arena_mermaid_node( format!("{indent}{}{{{{\"{}\"}}}}", idx.index(), arena_idx) } ArenaNode::ELEM(label) => { - format!("{indent}{}(\"{}\")", idx.index(), label.replace("\"", "'")) + format!("{indent}{}(\"{}\")", idx.index(), label.replace('"', "'")) } ArenaNode::CVAR(label) => { - format!("{indent}{}(\"{}\")", idx.index(), label.replace("\"", "'")) + format!("{indent}{}(\"{}\")", idx.index(), label.replace('"', "'")) } }; diff --git a/crates/solc-expressions/src/literal.rs b/crates/solc-expressions/src/literal.rs index 97742856..3ed3e6c3 100644 --- a/crates/solc-expressions/src/literal.rs +++ b/crates/solc-expressions/src/literal.rs @@ -312,9 +312,9 @@ mod tests { let func_node = analyzer.graph.add_node(Node::Function(func)).into(); let loc = Loc::File(0, 0, 0); - let ctx = Context::new(func_node, format!("{}", "test_fn"), loc); - let ctx_node = ContextNode::from(analyzer.graph.add_node(Node::Context(ctx))); - ctx_node + let ctx = Context::new(func_node, "test_fn".to_string(), loc); + + ContextNode::from(analyzer.graph.add_node(Node::Context(ctx))) } fn test_number_literal(