diff --git a/smt-log-parser/src/cmd/args.rs b/smt-log-parser/src/cmd/args.rs index 7d5e4b4a..6e2dd6ee 100644 --- a/smt-log-parser/src/cmd/args.rs +++ b/smt-log-parser/src/cmd/args.rs @@ -26,5 +26,5 @@ pub enum Commands { Test { /// The paths to the smt log files logfiles: Vec, - } + }, } diff --git a/smt-log-parser/src/cmd/dependencies.rs b/smt-log-parser/src/cmd/dependencies.rs index 4b09ab8d..355cb1bd 100644 --- a/smt-log-parser/src/cmd/dependencies.rs +++ b/smt-log-parser/src/cmd/dependencies.rs @@ -1,5 +1,5 @@ -use std::path::PathBuf; use fxhash::{FxHashMap, FxHashSet}; +use std::path::PathBuf; use smt_log_parser::{ analysis::{ @@ -94,9 +94,9 @@ fn get_node_name<'a>( fn build_axiom_dependency_graph( parser: &Z3Parser, ) -> Result>, smt_log_parser::Error> { - let inst_graph = RawInstGraph::new(&parser)?; + let inst_graph = RawInstGraph::new(parser)?; let node_name_map: FxHashMap = - named_nodes(&inst_graph, &parser, inst_graph.node_indices()) + named_nodes(&inst_graph, parser, inst_graph.node_indices()) .map(|(n, v)| (n, v.into())) .collect(); let mut node_dep_map: FxHashMap> = FxHashMap::default(); @@ -112,7 +112,7 @@ fn build_axiom_dependency_graph( continue; } for node in inst_graph.neighbors_directed(node, petgraph::Direction::Incoming) { - let is_named = get_node_name(&inst_graph, &parser, node).is_some(); + let is_named = get_node_name(&inst_graph, parser, node).is_some(); // if this is a quantified axiom with a name, add it to the list of dependencies if is_named { dependent_nodes.insert(node); @@ -133,7 +133,7 @@ fn build_axiom_dependency_graph( entry.or_default().extend(dependent_node_names); } - return Ok(node_dep_map); + Ok(node_dep_map) } /// extends the dependency graph by 1 transitive step @@ -141,7 +141,7 @@ fn extend_by_transitive_deps(axiom_deps: &mut FxHashMap = - axiom_deps.get(&dep).map(|v| v.clone()).unwrap_or_default(); + axiom_deps.get(&dep).cloned().unwrap_or_default(); axiom_deps.get_mut(&axiom).unwrap().extend(extended_deps); } } diff --git a/smt-log-parser/src/cmd/mod.rs b/smt-log-parser/src/cmd/mod.rs index 09f0fb2f..99493c50 100644 --- a/smt-log-parser/src/cmd/mod.rs +++ b/smt-log-parser/src/cmd/mod.rs @@ -1,16 +1,18 @@ mod args; -mod test; mod dependencies; +mod test; use clap::Parser; pub fn run() -> Result<(), String> { match args::Cli::parse().command { - args::Commands::Dependencies { logfile, depth, pretty_print } => - dependencies::run(logfile, depth, pretty_print)?, - args::Commands::Test { logfiles } => - test::run(logfiles)?, + args::Commands::Dependencies { + logfile, + depth, + pretty_print, + } => dependencies::run(logfile, depth, pretty_print)?, + args::Commands::Test { logfiles } => test::run(logfiles)?, } - + Ok(()) }