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)]
|
#[derive(Debug)]
|
||||||
pub struct ElementNr<'a> {
|
pub struct ElementNr {
|
||||||
element : &'a Element,
|
element : &'static Element,
|
||||||
nr : u32
|
nr : u32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ use periodic_table::Element;
|
|||||||
use crate::ElementNr;
|
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 char_before: Option<char> = None;
|
||||||
let mut element: Option<&Element> = None;
|
let mut element: Option<&Element> = None;
|
||||||
let mut element_line: Vec<ElementNr> = vec![];
|
let mut element_line: Vec<ElementNr> = vec![];
|
||||||
|
|||||||
@ -2,11 +2,11 @@ use periodic_table::Element;
|
|||||||
|
|
||||||
use crate::ElementNr;
|
use crate::ElementNr;
|
||||||
|
|
||||||
pub struct Variation {
|
pub struct Variation<'a> {
|
||||||
longest: Element
|
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![];
|
let mut variations: Vec<Variation> = vec![];
|
||||||
|
|
||||||
variations
|
variations
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user