wrap brain around Copy,Clone,Reference of the Element type

This commit is contained in:
2023-11-22 23:44:49 +01:00
parent fe974adddb
commit a832375716
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -13,8 +13,8 @@ use crate::variations::calculate::get_variations;
#[derive(Debug)]
pub struct ElementNr<'a> {
element : &'a Element,
pub struct ElementNr {
element : &'static Element,
nr : u32
}
+1 -1
View File
@@ -2,7 +2,7 @@ use periodic_table::Element;
use crate::ElementNr;
pub fn parse(arg: &String) -> Vec<ElementNr<'static>> {
pub fn parse(arg: &String) -> Vec<ElementNr> {
let mut char_before: Option<char> = None;
let mut element: Option<&Element> = None;
let mut element_line: Vec<ElementNr> = vec![];
+3 -3
View File
@@ -2,11 +2,11 @@ use periodic_table::Element;
use crate::ElementNr;
pub struct Variation {
longest: Element
pub struct Variation<'a> {
longest: &'a ElementNr,
}
pub fn get_variations(elements: Vec<ElementNr>) -> Vec<Variation> {
pub fn get_variations(elements: Vec<ElementNr>) -> Vec<Variation<'static>> {
let mut variations: Vec<Variation> = vec![];
variations