From 79a3006fa27bbbdf9b9e41fe7bd1d08f976b5f8e Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Tue, 7 Mar 2023 06:48:35 +0100 Subject: [PATCH] Reformat(All) - Reformats the code --- Makefile.toml | 9 +++++---- rustfmt.toml | 2 +- src/action.rs | 9 ++++----- src/craft.rs | 1 - src/io.rs | 22 +++++++++++----------- src/solver.rs | 4 ++-- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index b9d99a1..92956fa 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -18,10 +18,11 @@ script = [ "twine upload releases/xiv_csolver_lib*.whl --repository gitea", ] -[tasks.format] -install_crate = "rustfmt" -command = "cargo" -args = ["fmt", "--", "--emit=files"] +[tasks.fmt] +script_runner = "@shell" +script = [ +"cargo +nightly fmt -- --config format_code_in_doc_comments=true" +] [tasks.testcov] script_runner = "@shell" diff --git a/rustfmt.toml b/rustfmt.toml index 4e727a0..44148a2 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1 +1 @@ -reorder_imports = true \ No newline at end of file +reorder_imports = true diff --git a/src/action.rs b/src/action.rs index fe4d716..0ae718d 100644 --- a/src/action.rs +++ b/src/action.rs @@ -2,7 +2,6 @@ //! //! All actions are defined as Action, containing all methods to actively use it in a craft //! while ActionBuilder is used only initally as a lazy_static setup -//! use crate::craft::Craft; use crate::specs::{Buff, Success}; @@ -45,10 +44,10 @@ impl ActionBuilder { /// use xiv_csolver_lib::action::ActionBuilder; /// use xiv_csolver_lib::specs::Buff; /// ActionBuilder::new("Muscle Memory") - /// .cp(6) - /// .progress(300) - /// .buff(Some((Buff::MuscleMemory, 5))) - /// .build(); + /// .cp(6) + /// .progress(300) + /// .buff(Some((Buff::MuscleMemory, 5))) + /// .build(); /// ``` pub fn new(name: &str) -> Self { let mut short_name = name.to_string(); diff --git a/src/craft.rs b/src/craft.rs index 777e696..cbffb01 100644 --- a/src/craft.rs +++ b/src/craft.rs @@ -3,7 +3,6 @@ //! A craft represent the state of the recipe with a vector of actions applied to it. //! Applying actions to it will make the craft progress, while branching and trying other actions //! will be done by cloning -//! use crate::action::Action; use crate::specs::{Buff, BuffState, Recipe, Stats, Success}; diff --git a/src/io.rs b/src/io.rs index c9bd331..e4214b7 100644 --- a/src/io.rs +++ b/src/io.rs @@ -239,21 +239,21 @@ fn xiv_csolver_lib(_py: Python, m: &PyModule) -> PyResult<()> { /// [`default`](crate::io::SolverResult::default) /// ``` /// # use xiv_csolver_lib::io::SolverResult; -/// SolverResult{ +/// SolverResult { /// steps: 0, /// progression: 0, /// quality: 0, /// durability: 0, -/// total_progression: 0, -/// total_quality: 0, -/// total_durability: 0, -/// actions: vec!["Act1".to_string(), "Act2".to_string()], -/// step1_solutions: 0, -/// step2_solutions: 0, -/// found_100_percent: false, -/// cp: 0, -/// total_cp: 0, -/// }; +/// total_progression: 0, +/// total_quality: 0, +/// total_durability: 0, +/// actions: vec!["Act1".to_string(), "Act2".to_string()], +/// step1_solutions: 0, +/// step2_solutions: 0, +/// found_100_percent: false, +/// cp: 0, +/// total_cp: 0, +/// }; /// ``` #[cfg(not(feature = "no_python"))] #[pyfunction] diff --git a/src/solver.rs b/src/solver.rs index d16af34..3ed2fe6 100644 --- a/src/solver.rs +++ b/src/solver.rs @@ -26,11 +26,11 @@ pub fn next_action_picker_1<'a>(craft: &Craft<'a>) -> Vec> { // Prune some actions if not requested by --long if craft.step_count == 2 { - return action_vec![/*ACTIONS.waste_not, ACTIONS.waste_not_ii, */ ACTIONS.veneration]; + return action_vec![/* ACTIONS.waste_not, ACTIONS.waste_not_ii, */ ACTIONS.veneration]; } if craft.step_count == 3 { available_actions.append(&mut action_vec![ - ACTIONS.waste_not_ii /*,ACTIONS.waste_not*/ + ACTIONS.waste_not_ii /* ,ACTIONS.waste_not */ ]) }