wrap brain around Copy,Clone,Reference of the Element type
This commit is contained in:
parent
fe974adddb
commit
a832375716
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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![];
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user