diff options
| author | lukeflo | 2024-10-17 23:02:06 +0200 |
|---|---|---|
| committer | lukeflo | 2024-10-17 23:02:06 +0200 |
| commit | 1fb272e563aca3b90a82fcbef68ed1c28cb7b212 (patch) | |
| tree | 8dc10dd07d80556d53ce7276cfddf47de1fec496 /src/backend/bib.rs | |
| parent | 5abdd1822a1d388feb36b0d4e62316b4671bf406 (diff) | |
| download | bibiman-1fb272e563aca3b90a82fcbef68ed1c28cb7b212.tar.gz bibiman-1fb272e563aca3b90a82fcbef68ed1c28cb7b212.zip | |
Implement sorting and remove unneccessary struct
- Implement sorting of list (by authors for now)
- Remove hole BibiData struct
- Create entry table content directly through iterator
Diffstat (limited to 'src/backend/bib.rs')
| -rw-r--r-- | src/backend/bib.rs | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/src/backend/bib.rs b/src/backend/bib.rs index 8539ab3..aca08b3 100644 --- a/src/backend/bib.rs +++ b/src/backend/bib.rs @@ -113,61 +113,6 @@ impl BibiMain { keyword_list.dedup(); keyword_list } -} - -#[derive(Debug)] -pub struct BibiData { - pub entry_list: BibiDataSets, -} - -impl BibiData { - pub fn new(biblio: &Bibliography, citekeys: &Vec<String>) -> Self { - Self { - entry_list: { - let bibentries = citekeys - .into_iter() - .map(|citekey| BibiEntry::new(&citekey, &biblio)) - .collect(); - BibiDataSets { bibentries } - }, - } - } -} - -// Parent struct which keeps the Vector of all bibentries -// Necessary for implementing FromIterator -#[derive(Debug)] -pub struct BibiDataSets { - pub bibentries: Vec<Vec<String>>, -} - -// Struct which has to be created for every entry of bibdatabase -#[derive(Debug)] -pub struct BibiEntry { - pub authors: String, - pub title: String, - pub year: String, - pub pubtype: String, - pub keywords: String, - pub citekey: String, - pub weblink: String, - pub filepath: String, -} - -impl BibiEntry { - pub fn new(citekey: &str, biblio: &Bibliography) -> Vec<String> { - vec![ - Self::get_authors(&citekey, &biblio), - Self::get_title(&citekey, &biblio), - Self::get_year(&citekey, &biblio), - Self::get_pubtype(&citekey, &biblio), - Self::get_keywords(&citekey, &biblio), - citekey.to_string(), - Self::get_abstract(&citekey, &biblio), - Self::get_weblink(&citekey, &biblio), - Self::get_filepath(&citekey, &biblio), - ] - } pub fn get_authors(citekey: &str, biblio: &Bibliography) -> String { if biblio.get(&citekey).unwrap().author().is_ok() { |
