diff --git a/crates/conjure_core/src/solver/adaptors/rustsat.rs b/crates/conjure_core/src/solver/adaptors/rustsat.rs index f771bb14ae..376e4840d0 100644 --- a/crates/conjure_core/src/solver/adaptors/rustsat.rs +++ b/crates/conjure_core/src/solver/adaptors/rustsat.rs @@ -106,9 +106,9 @@ pub fn instantiate_model_from_conjure( Ok(inst) } -fn solve(&mut solver_inst: Minisat, model_inst: Option) -> bool { +fn solve(&mut solver_inst: Minisat, model_inst: SatInstance) -> bool { - let cnf_func: rustsat::instances::Cnf = model_inst.clone().unwrap().into_cnf().0; + let cnf_func: rustsat::instances::Cnf = model_inst.clone().into_cnf().0; solver_inst.add_cnf(cnf_func); let res = solver_inst.solve().unwrap(); @@ -117,7 +117,7 @@ fn solve(&mut solver_inst: Minisat, model_inst: Option) -> bool { SolverResult::Unsat => false, // should not arise: - SolverResult::Interrupted => panic!((format!("SatInstance may be invalid, Interrupted."))), + SolverResult::Interrupted => panic!("SatInstance may be invalid, Interrupted."), }; solver_res @@ -134,7 +134,7 @@ impl SolverAdaptor for SAT { // &self.solver_inst.add_cnf(cnf_func); // let res = &self.solver_inst.solve().unwrap(); - let solver_res = solve(self.solver_inst, self.model_inst); + let solver_res = solve(&mut self.solver_inst, self.model_inst.unwrap()); // error thrown always. impermanent // will eventually have a SolveSucess instance being returned with Ok(), when the implementation is more permanent.