From 3a56602d66d13f3cbcd433cf800f4ce0537b3256 Mon Sep 17 00:00:00 2001 From: fabolous005 Date: Wed, 22 Nov 2023 22:39:51 +0100 Subject: [PATCH] get submodules to work --- .gitmodules | 3 +++ Cargo.toml | 3 ++- pstable | 1 + src/main.rs | 13 +++++++++++++ src/parse.rs | 6 +----- src/variations/calculate.rs | 13 +++++++++++++ src/variations/mod.rs | 1 + 7 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 .gitmodules create mode 160000 pstable diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c64c1ac --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "pstable"] + path = pstable + url = ./pstable/ diff --git a/Cargo.toml b/Cargo.toml index 1104868..9e1a82a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,4 +6,5 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -periodic_table = { version = "0.5.0", path = "../periodic_table/" } +# periodic_table = { version = "0.5.0", path = "./pstable/", git = "http://server1/fabolous005/pstable.git" } +periodic_table = { path = "./pstable/" } diff --git a/pstable b/pstable new file mode 160000 index 0000000..2d8040c --- /dev/null +++ b/pstable @@ -0,0 +1 @@ +Subproject commit 2d8040cd19b22d4acc287b9819f61d481f606c21 diff --git a/src/main.rs b/src/main.rs index f05a3fa..2950203 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,6 +7,17 @@ mod variations; use std::env; use parse::parse; +use periodic_table::Element; + +use crate::variations::calculate::get_variations; + + +#[derive(Debug)] +pub struct ElementNr<'a> { + element : &'a Element, + nr : u32 +} + fn main() { let mut args = vec![]; @@ -18,4 +29,6 @@ fn main() { println!("{:#?}", elements); println!("{}", elements.len()); // TODO: determine element group of each element + + let _variations = get_variations(elements); } diff --git a/src/parse.rs b/src/parse.rs index 22179ea..c31a8c4 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -1,10 +1,6 @@ use periodic_table::Element; +use crate::ElementNr; -#[derive(Debug)] -pub struct ElementNr<'a> { - element : &'a Element, - nr : u32 -} pub fn parse(arg: &String) -> Vec> { let mut char_before: Option = None; diff --git a/src/variations/calculate.rs b/src/variations/calculate.rs index e69de29..4b55881 100644 --- a/src/variations/calculate.rs +++ b/src/variations/calculate.rs @@ -0,0 +1,13 @@ +use periodic_table::Element; + +use crate::ElementNr; + +pub struct Variation { + longest: Element +} + +pub fn get_variations(elements: Vec) -> Vec { + let mut variations: Vec = vec![]; + + variations +} diff --git a/src/variations/mod.rs b/src/variations/mod.rs index e69de29..ed2498d 100644 --- a/src/variations/mod.rs +++ b/src/variations/mod.rs @@ -0,0 +1 @@ +pub mod calculate;