From 4333ee0147da6b5cbc8d19f7b90f4618c88773a8 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Sun, 19 Feb 2023 23:00:21 +0100 Subject: [PATCH] Fix(Misc) - Fixed most clone problems --- src/libs.rs | 15 ++++----------- src/main.rs | 1 + src/solver.rs | 2 -- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/libs.rs b/src/libs.rs index 5be6876..32bade0 100644 --- a/src/libs.rs +++ b/src/libs.rs @@ -47,14 +47,7 @@ pub struct Args { /// Solve the craft with given arguments pub fn solve_craft<'a>(recipe: Recipe, stats: Stats, params: Parameters) -> Option>{ - // let params = Parameters{ - // depth: args.depth, - // threads: args.threads, - // verbose: args.verbose, - // }; - - // // Load the craft with given arguments - // let craft = make_craft_from_config(&args.recipe_name, &args.file_name, &args.character_name,params); + // Load the craft with given arguments let craft = Craft::new(recipe,stats,params); // Start timer let now = Instant::now(); @@ -86,7 +79,7 @@ pub fn solve_craft<'a>(recipe: Recipe, stats: Stats, params: Parameters) -> Opti let arc_phase2_routes = Arc::new(Mutex::new(Vec::::new())); for route in phase1_routes { - let _phase2_routes = arc_phase2_routes.clone(); + let _phase2_routes = Arc::clone(&arc_phase2_routes); pool.execute(move || { if let Some(_route) = generate_routes_phase2(route){ @@ -152,8 +145,8 @@ pub fn solve_craft<'a>(recipe: Recipe, stats: Stats, params: Parameters) -> Opti println!("Press enter to exit..."); let mut input = String::new(); std::io::stdin().read_line(&mut input).unwrap(); - // Some(top_route.clone()) - None + Some(content) + // None } /// Load the config from args and make a craft from it diff --git a/src/main.rs b/src/main.rs index df2426b..bbf090c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +// #![warn(missing_docs,unsafe_code,unstable_features,)] use crate::libs::Parameters; use crate::libs::load_from_config; use clap::Parser; diff --git a/src/solver.rs b/src/solver.rs index 3b98b9b..2730936 100644 --- a/src/solver.rs +++ b/src/solver.rs @@ -89,8 +89,6 @@ pub fn generate_routes_phase1<'a>(craft: Craft<'a>) -> Vec> { pub fn next_action_phase_2<'a>(craft: & Craft<'a>) -> Vec> { - // println!("State of craft {:}",craft); - let mut available_actions = vec![&ACTIONS.basic_touch, &ACTIONS.prudent_touch, &ACTIONS.preparatory_touch]; let mut forbidden_actions = Vec::new(); if craft.success != Success::Pending { return vec![None]; }