From 72a1fa4fdcb674a72e0afa6b11aece0fecada5c6 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Mon, 6 Mar 2023 03:22:57 +0100 Subject: [PATCH] Release(0.1.7) - Test, release and Format Also renamed files --- Cargo.lock | 2 +- Cargo.toml | 2 +- pyproject.toml | 2 +- python/pyproject.toml | 2 +- .../{ffcraft_solver.ico => xiv_csolver.ico} | Bin .../{ffcraft_solver.png => xiv_csolver.png} | Bin src/craft.rs | 11 +--- src/specs.rs | 55 ++++++++++-------- 8 files changed, 38 insertions(+), 36 deletions(-) rename python/src/xiv_csolver/ressources/{ffcraft_solver.ico => xiv_csolver.ico} (100%) rename python/src/xiv_csolver/ressources/{ffcraft_solver.png => xiv_csolver.png} (100%) diff --git a/Cargo.lock b/Cargo.lock index 18a2bae..e53a325 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -590,7 +590,7 @@ checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" [[package]] name = "xiv_csolver" -version = "0.1.6" +version = "0.1.7" dependencies = [ "clap", "lazy_static", diff --git a/Cargo.toml b/Cargo.toml index c49e98e..e3e6c0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xiv_csolver" -version = "0.1.6" +version = "0.1.7" edition = "2021" authors = ["谭俊健","Dandaedre","Vkyfox"] description = "Small XIV solver library in rust, with python and rust bindings" diff --git a/pyproject.toml b/pyproject.toml index 7e21dc0..5c2868e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "maturin" [project] # The rust bindings name = "xiv_csolver_lib" requires-python = ">=3.7" -version = "0.1.6" +version = "0.1.7" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", diff --git a/python/pyproject.toml b/python/pyproject.toml index f2d2440..efed611 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -9,7 +9,7 @@ authors = [ {name="Dandaedre"}, ] requires-python = ">=3.7" -version = "0.1.6" +version = "0.1.7" license = {text="Mozilla Public License Version 2.0"} classifiers = [ "Programming Language :: Rust", diff --git a/python/src/xiv_csolver/ressources/ffcraft_solver.ico b/python/src/xiv_csolver/ressources/xiv_csolver.ico similarity index 100% rename from python/src/xiv_csolver/ressources/ffcraft_solver.ico rename to python/src/xiv_csolver/ressources/xiv_csolver.ico diff --git a/python/src/xiv_csolver/ressources/ffcraft_solver.png b/python/src/xiv_csolver/ressources/xiv_csolver.png similarity index 100% rename from python/src/xiv_csolver/ressources/ffcraft_solver.png rename to python/src/xiv_csolver/ressources/xiv_csolver.png diff --git a/src/craft.rs b/src/craft.rs index c1c0446..863fa66 100644 --- a/src/craft.rs +++ b/src/craft.rs @@ -184,14 +184,9 @@ impl<'a> Display for Craft<'a> { } } - #[cfg(test)] -mod test{ +mod test { // Struct Test #[test] - pub fn struct_tests(){ - - } - - -} \ No newline at end of file + pub fn struct_tests() {} +} diff --git a/src/specs.rs b/src/specs.rs index 423ef9b..5070f26 100644 --- a/src/specs.rs +++ b/src/specs.rs @@ -186,7 +186,7 @@ impl BuffState { /// State the craft is in, used to keep track of wether the craft /// is to be worked on, added to the success vector or discarded -#[derive(Debug,Clone,PartialEq)] +#[derive(Debug, Clone, PartialEq)] pub enum Success { /// Pending success and therefor still ongoing Pending, @@ -200,45 +200,52 @@ pub enum Success { #[cfg(test)] mod tests { // Test default values - use pretty_assertions::{assert_eq}; + use pretty_assertions::assert_eq; use strum::IntoEnumIterator; #[test] pub fn test_structs() { - format!("{:?}",crate::specs::Recipe { - durability: 0, - progress: 0, - progress_divider: 0, - progress_modifier: 0, - quality: 0, - quality_divider: 0, - quality_modifier: 0, - }.clone()); + format!( + "{:?}", + crate::specs::Recipe { + durability: 0, + progress: 0, + progress_divider: 0, + progress_modifier: 0, + quality: 0, + quality_divider: 0, + quality_modifier: 0, + } + .clone() + ); - format!("{:?}",crate::specs::Stats { - craftsmanship: 0, - control: 0, - max_cp: 0, - } - .clone()); + format!( + "{:?}", + crate::specs::Stats { + craftsmanship: 0, + control: 0, + max_cp: 0, + } + .clone() + ); let iq = crate::specs::Buff::InnerQuiet; assert_eq!(crate::specs::Buff::InnerQuiet, iq); - for buff in crate::specs::Buff::iter(){ - format!("{:?}",buff); + for buff in crate::specs::Buff::iter() { + format!("{:?}", buff); } format!("{:?}", crate::specs::BuffState::default().clone()); let sc = crate::specs::Success::Pending; - assert!(crate::specs::Success::Pending==sc); - assert!(crate::specs::Success::Success!=sc); - format!("{:?}",sc); + assert!(crate::specs::Success::Pending == sc); + assert!(crate::specs::Success::Success != sc); + format!("{:?}", sc); } #[test] pub fn test_buffstate() { let mut bbs = crate::specs::BuffState::default(); - for buff in crate::specs::Buff::iter(){ + for buff in crate::specs::Buff::iter() { bbs.apply(buff, 2); } assert_eq!(bbs.inner_quiet, 2); @@ -261,7 +268,7 @@ mod tests { bbs.tick(); assert_eq!(bbs.inner_quiet, 3); assert_eq!(bbs.innovation, 4); - for buff in crate::specs::Buff::iter(){ + for buff in crate::specs::Buff::iter() { bbs.remove(buff); } assert_eq!(bbs.inner_quiet, 0);