Reformat(All) - Reformats the code

This commit is contained in:
Dandaedre 2023-03-07 06:48:35 +01:00 committed by Gitea
parent 5cd3d65de6
commit 79a3006fa2
6 changed files with 23 additions and 24 deletions

View File

@ -18,10 +18,11 @@ script = [
"twine upload releases/xiv_csolver_lib*.whl --repository gitea", "twine upload releases/xiv_csolver_lib*.whl --repository gitea",
] ]
[tasks.format] [tasks.fmt]
install_crate = "rustfmt" script_runner = "@shell"
command = "cargo" script = [
args = ["fmt", "--", "--emit=files"] "cargo +nightly fmt -- --config format_code_in_doc_comments=true"
]
[tasks.testcov] [tasks.testcov]
script_runner = "@shell" script_runner = "@shell"

View File

@ -1 +1 @@
reorder_imports = true reorder_imports = true

View File

@ -2,7 +2,6 @@
//! //!
//! All actions are defined as Action, containing all methods to actively use it in a craft //! 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 //! while ActionBuilder is used only initally as a lazy_static setup
//!
use crate::craft::Craft; use crate::craft::Craft;
use crate::specs::{Buff, Success}; use crate::specs::{Buff, Success};
@ -45,10 +44,10 @@ impl ActionBuilder {
/// use xiv_csolver_lib::action::ActionBuilder; /// use xiv_csolver_lib::action::ActionBuilder;
/// use xiv_csolver_lib::specs::Buff; /// use xiv_csolver_lib::specs::Buff;
/// ActionBuilder::new("Muscle Memory") /// ActionBuilder::new("Muscle Memory")
/// .cp(6) /// .cp(6)
/// .progress(300) /// .progress(300)
/// .buff(Some((Buff::MuscleMemory, 5))) /// .buff(Some((Buff::MuscleMemory, 5)))
/// .build(); /// .build();
/// ``` /// ```
pub fn new(name: &str) -> Self { pub fn new(name: &str) -> Self {
let mut short_name = name.to_string(); let mut short_name = name.to_string();

View File

@ -3,7 +3,6 @@
//! A craft represent the state of the recipe with a vector of actions applied to it. //! 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 //! Applying actions to it will make the craft progress, while branching and trying other actions
//! will be done by cloning //! will be done by cloning
//!
use crate::action::Action; use crate::action::Action;
use crate::specs::{Buff, BuffState, Recipe, Stats, Success}; use crate::specs::{Buff, BuffState, Recipe, Stats, Success};

View File

@ -239,21 +239,21 @@ fn xiv_csolver_lib(_py: Python, m: &PyModule) -> PyResult<()> {
/// [`default`](crate::io::SolverResult::default) /// [`default`](crate::io::SolverResult::default)
/// ``` /// ```
/// # use xiv_csolver_lib::io::SolverResult; /// # use xiv_csolver_lib::io::SolverResult;
/// SolverResult{ /// SolverResult {
/// steps: 0, /// steps: 0,
/// progression: 0, /// progression: 0,
/// quality: 0, /// quality: 0,
/// durability: 0, /// durability: 0,
/// total_progression: 0, /// total_progression: 0,
/// total_quality: 0, /// total_quality: 0,
/// total_durability: 0, /// total_durability: 0,
/// actions: vec!["Act1".to_string(), "Act2".to_string()], /// actions: vec!["Act1".to_string(), "Act2".to_string()],
/// step1_solutions: 0, /// step1_solutions: 0,
/// step2_solutions: 0, /// step2_solutions: 0,
/// found_100_percent: false, /// found_100_percent: false,
/// cp: 0, /// cp: 0,
/// total_cp: 0, /// total_cp: 0,
/// }; /// };
/// ``` /// ```
#[cfg(not(feature = "no_python"))] #[cfg(not(feature = "no_python"))]
#[pyfunction] #[pyfunction]

View File

@ -26,11 +26,11 @@ pub fn next_action_picker_1<'a>(craft: &Craft<'a>) -> Vec<Option<&'a Action>> {
// Prune some actions if not requested by --long // Prune some actions if not requested by --long
if craft.step_count == 2 { 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 { if craft.step_count == 3 {
available_actions.append(&mut action_vec![ available_actions.append(&mut action_vec![
ACTIONS.waste_not_ii /*,ACTIONS.waste_not*/ ACTIONS.waste_not_ii /* ,ACTIONS.waste_not */
]) ])
} }